I'm using R. I have very many files in .csv format which I would like to read and then combine them into a data frame with each file representing a column, so that I can manipulate using simple statistics. How can I go about this?
Asked
Active
Viewed 57 times
2 Answers
0
Assuming that files
contains the list of your files,
ff <- sapply(files, read.csv)
df <- Reduce(cbind, ff)
First command loads all files. Second command merges all files into one data frame. Clearly, I am assuming that all files have one column and the same number of rows. You can check that with
sapply(ff, nrow)
sapply(ff, ncol)

January
- 16,320
- 6
- 52
- 74