Skip to content

Problem with merge() (PR#1102)

2 messages · Don MacQueen, Martin Maechler

#
I have encountered a problem with merge() that appears to be a bug.
Here's an example to illustrate it.
Error in "names<-.default"(*tmp*, value = vnames) :
         names attribute must be the same length as the vector


I'm using R 1.3.0, and it occurs on both the Macintosh and Solaris versions.
_
platform powerpc-apple-darwin1.3.7
arch     powerpc
os       darwin1.3.7
system   powerpc, darwin1.3.7
status
major    1
minor    3.0
year     2001
month    06
day      22
language R
_
platform sparc-sun-solaris2.7
arch     sparc
os       solaris2.7
system   sparc, solaris2.7
status
major    1
minor    3.0
year     2001
month    06
day      22
language R
(I've searched various places, including a list of fixes for v1.3.1, 
the faq, 2001 r-help archives, and haven't found anything about it)

Thanks
-Don
#
Don> I have encountered a problem with merge() that appears to be a bug.
    Don> Here's an example to illustrate it.

    >> tmp1 <- data.frame(a=letters[1:3],b=LETTERS[2:4],x=1:3)
    >> tmpa <- expand.grid(a=letters[1:4],b=LETTERS[1:4])
    >> tmpm.1 <- merge(tmpa,tmp1)
    >> tmpm.2 <- merge(tmp1,tmpa)
    Don> Error in "names<-.default"(*tmp*, value = vnames) :
    Don> names attribute must be the same length as the vector


    Don> I'm using R 1.3.0, and it occurs on both the Macintosh and Solaris versions.
    >> version

Bug confirmed, also for the current version of R (1.3.1) and the 
development one.

I'll have a look.

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