R 3.0.3: I have 40 csv files all structured the same that I want to rbind
into one file so I can calculate the mean of one column.
I searched:
- this website
R in a Nutshell
R_Intro
sources?rbind Help
in RStudio
I cannot find the answer.
Any suggestions/pointers?
Using the answer from here [Importing several files and indexing them ]
list files with .csv extension - this assumes that the only .csv files in your working directory are the ones you want to read
read files into a list - are there headers?
rbind files
You can then find the mean - find which columns are numeric
find the mean of numeric variables
In more contemporary plyr approach:
(it's saturday afternoon: untested code, but the approach is fine)