csv - Using reduce... merge in R causes extensive duplication -
i have 13 csv files each 315-320 observations of total of 26 variables plus id column merge in r. attempted using following code:
filenames<-list.files(path="mergefolder") mergedata<-llply(filenames, read.csv) allcases<-reduce(function(x,y) {merge(x,y, all=t, by="studyid")},mergedata, accumulate=f)
however, final product (allcases) file extensive replication total of 3422736 obs.
can point me doing wrong?
thanks in advance.
Comments
Post a Comment