Full_Name: Martin Elff Version: 1.5.0 OS: MS Windows 98 Submission from: (NULL) (134.155.91.46) Merging of two data frames by variables with different names (using by.x and by.y) is no longer possible (it was possible in version 1.4.1). Call: mvoteint.classd.matadd <- merge( unique(mvoteint.classd), unique(subset(dimens.mpp, select=c(nation,year,mecode, econlrdiff, eeconlrdiff, welfdiff, labmiddiff, authlibdiff, authlibdiffn) )), by.x=c("nation","eyear","mvoteint"), by.y=c("nation","year","mecode"), all.x=TRUE, sort=TRUE ) Error message: Error in match.names(clabs, names(xi)) : names don't match previous names: year, mecode Traceback: 10: stop(paste("names don't match previous names:\n ", paste(nmi[nii == 0], collapse = ", "))) 9: match.names(clabs, names(xi)) 8: rbind(...) 7: rbind(x[, by.x], y[, by.y]) 6: do.call("paste", c(rbind(x[, by.x], y[, by.y]), sep = "\r")) 5: merge.data.frame(unique(mvoteint.classd), unique(subset(dimens.mpp, select = c(nation, year, mecode, econlrdiff, eeconlrdiff, welfdiff, labmiddiff, authlibdiff, authlibdiffn))), by.x c("nation", "eyear", "mvoteint"), by.y = c("nation", "year", "mecode"), all.x = TRUE, sort = TRUE) 4: merge(unique(mvoteint.classd), unique(subset(dimens.mpp, select = c(nation, year, mecode, econlrdiff, eeconlrdiff, welfdiff, labmiddiff, authlibdiff, authlibdiffn))), by.x = c("nation", "eyear", "mvoteint"), by.y = c("nation", "year", "mecode"), all.x = TRUE, sort = TRUE) 3: eval.with.vis(expr, envir, enclos) 2: eval.with.vis(ei, envir) 1: source("setup-classd-mat-additiv.R", echo = T) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 3 May 2002 elff@rumms.uni-mannheim.de wrote:> Full_Name: Martin Elff > Version: 1.5.0 > OS: MS Windows 98 > Submission from: (NULL) (134.155.91.46) > > > Merging of two data frames by variables with different names > (using by.x and by.y) is no > longer possible (it was possible in version 1.4.1).To be precise, it doesn't seem to work with multiple by columns, so> df<-data.frame(x=1:10,y=rnorm(10)) > fd<-data.frame(z=1:10,w=rnorm(10)) > merge(df,fd,by.x="x",by.y="z")succeeds but> fd<-data.frame(z=1:10,m=letters[1:10],w=rnorm(10)) > df<-data.frame(x=1:10,y=rnorm(10),n=letters[1:10]) > merge(df,fd,by.x=c("x","n"),by.y=c("z","m"))Error in match.names(clabs, names(xi)) : names don't match previous names: z, m -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 3 May 2002, Thomas Lumley wrote:> On Fri, 3 May 2002 elff@rumms.uni-mannheim.de wrote: > > > Full_Name: Martin Elff > > Version: 1.5.0 > > OS: MS Windows 98 > > Submission from: (NULL) (134.155.91.46) > > > > > > Merging of two data frames by variables with different names > > (using by.x and by.y) is no > > longer possible (it was possible in version 1.4.1). > > To be precise, it doesn't seem to work with multiple by columns, so > > df<-data.frame(x=1:10,y=rnorm(10)) > > fd<-data.frame(z=1:10,w=rnorm(10)) > > merge(df,fd,by.x="x",by.y="z") > succeeds butYes, and there is an example on the help page for that case.> > fd<-data.frame(z=1:10,m=letters[1:10],w=rnorm(10)) > > df<-data.frame(x=1:10,y=rnorm(10),n=letters[1:10]) > > merge(df,fd,by.x=c("x","n"),by.y=c("z","m")) > Error in match.names(clabs, names(xi)) : names don't match previous names: > z, mYes, the code is different for multiple match columns, and I know how to fix it. Thank you Thomas for the example: creating one was my next task. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._