Description Usage Arguments Author(s) References Examples
Combines multiple csv files into one data frame
1 | multmerge(mypath, fileEncoding = "")
|
mypath |
the path where the csv files live. NOTE: only csv files can be in the path called |
fileEncoding |
This follows the same rules as the fileEncoding argument in read.csv. Added in because this was needed for a project |
Chris Friedman
Tony Cookson's post, available at http://novicemetrics.blogspot.com/2011/04/merging-multiple-data-files-into-one.html
1 2 3 4 5 6 7 8 9 10 11 12 13 | multmerge("./data/")
this will return a data frame of all the csv files in the path in one frame.
## The function is currently defined as
function (mypath, fileEncoding)
{
filenames=list.files(path=mypath, full.names=TRUE)
datalist = lapply(filenames,
function(x){read.csv(file=x,
header=T,
fileEncoding = fileEncoding)})
Reduce(function(x,y) {rbind(x,y)}, datalist)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.