I am currently using this code to enter data from multiple files in R:
library(foreign) setwd("/Users/ericbrotto/Desktop/A_Intel/") filelist <-list.files() #assuming tab separated values with a header datalist = lapply(filelist, function(x)read.table(x, header=T, sep=";", comment.char="")) #assuming the same header/columns for all files datafr = do.call("rbind", datalist)
The headers are as follows:
TIME ;POWER SOURCE ;qty MONITORS ;NUM PROCESSORS ;freq of CPU Mhz ;SCREEN SIZE ;CPU LOAD ;BATTERY LEVEL ; KEYBOARD MVT ; MOUSE MVT ;BATTERY MWH ;HARD DISK SPACE ;NUMBER PROCESSES ;RAM ;RUNNING APPS ;FOCUS APP ;BYTES IN ;BYTES OUT ;ACTIVE NETWORKS ; IP ADDRESS ; NAMES OF FILES ;
and the sample data is as follows:
2010-09-11-19:28:34.680 ; BA ; 1 ; 2 ; 2000 ; 1440 : 900 ; 0.224121 ; 92 ; NO ; NO ; NULL ; 92.581558 ; 57 ; 196.1484375 ; +NULL ; loginwindow-#35 ; 5259 ; 4506 ; en1 : ; 192.168.1.3 ; NULL ;
Instead, enter all the columns in the data frame, I would just grab one, say FOCUS APP.
source share