Displaying 1 result from an estimated 1 matches for "merepk".
2012 Nov 02
1
mergeing a large number of large .csvs
...e to merge.
multmerge = function(mypath){
filenames=list.files(path=mypath, full.names=TRUE)
datalist = try(lapply(filenames, function(x){read.csv(file=x,header=T)}))
try(Reduce(function(x,y) {merge(x, y, all=TRUE)}, datalist))
}
#this function renames files using a fixed list and outputs a .csv
merepk <- function (path, nf.name) {
output<-multmerge(mypath=path)
name <- list("x", "y", "z", "depth", "amplitude")
try(names(output) <- name)
write.csv(output, nf.name)
}
#assumes all folders are in the same directory, with nothing else t...