Hi All,

I'm getting some weird problems with merge(), which give me the

Error in match.names(clabs, names(xi)) :
  names do not match previous names

Error.

I've found other people discussing this error, but they don't seem to match
my situation, and the strange thing is that changing the order of the data
frames that I'm merging can remove the error.

For example:


bt <- merge(assessmentb, assessmentb2,  by=("caseid"), all=TRUE)
bt <- merge(bt, tbassessment2,  by=("caseid"), all=TRUE)
bt <- merge(bt, tbarms2,  by=("caseid"), all=TRUE)
bt <- merge(bt, tbstudydetail,  by=("caseid"), all=TRUE)

But if I change it to:


bt <- merge(assessmentb, assessmentb2,  by=("caseid"), all=TRUE)
bt <- merge(bt, tbarms2,  by=("caseid"), all=TRUE)
bt <- merge(bt, tbstudydetail,  by=("caseid"), all=TRUE)
bt <- merge(bt, tbassessment2,  by=("caseid"), all=TRUE)    # <<<  This one
moved from second place to the end


The error occurs.

SImilarly, I find:

bt <- merge(np, bt,  by=("caseid"), all=TRUE)

Gives the error, but swapping the order of the data frames does not

bt <- merge( bt, np,  by=("caseid"), all=TRUE)     #  Changed from np, bt to
 bt,np.


The code always worked fine before, until someone 'helpfully' duplicated
some of the variables across the data frames, so in addition to caseid, each
also contains AuthorYr and StudyDesign.

Thanks,

Jeremy









-- 
Jeremy Miles
Psychology Research Methods Wiki: www.researchmethodsinpsychology.com

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to