I am currently using this code to write data from several files in R:
< Pre> library (foreign) setwd ("/ user / ericbrotto / desktop / a_intl /") file list & lt; -list.files () # Header Datlist = Value tab separated by tabs with lapply (filelist, function (x) read.table (x, all files datafr = do.call ("rbind", donor) Header looks like this: TIME; Power source; Volume monitors; NUM processor; Frequency of CPU MHz; Screen size; CPU load; Battery level; Keyboard MVT; Mouse mvt; Battery MWH; Hard disk space; Number processes; RAM; Running Apples; Focus APP; BYTES; Bytes out; Active network; IP address; Names of files;
An example of more data looks like this:
2010-09-11-19: 28: 34.680; B. A ; 1; 2; 2000; 1440: 900; 0.224121; 92; No ; No ; Zero ; 92.581558; 57; 196.1484375; + Null; Loginwindow- # 35; 5259; 4506; N1:; 192.168.1.3; Zero ;
Instead, input all the columns in the data frame. I just want to hold one, say, Focus APP
If you want to read from your files in any special column then the colClasses
is the way to go Let's say that your data looks like this:
a, b 1,2 3,4
then
< Use the callclasses to select the code # # Columns ## "Faucet" means the column Leave the column ## "numerical" means that the column is numeric ## Other options are the dates, factors - let's use read.table for more ## Determine the data = read.table ("/ Tmp / tmp.csv ", sep =", ", colClasses = c (" NULL "," numeric "), header = TRUE)
only gives the second column.
& gt; Data B1 2 2 4
Comments
Post a Comment