[Rd] merge (PR#1510)

elff@rumms.uni-mannheim.de elff@rumms.uni-mannheim.de
Fri, 3 May 2002 16:42:30 +0200 (MET DST)


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._