From ripley at stats.ox.ac.uk  Thu Sep 16 07:50:18 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu Sep 16 07:50:20 2004
Subject: [Rd] Bug in merge() in R-2.0.0 alpha
In-Reply-To: <414858D5.7060308@statistik.uni-dortmund.de>
Message-ID: <Pine.LNX.4.44.0409160644390.9075-100000@gannet.stats>

On Wed, 15 Sep 2004, Uwe Ligges wrote:

> In some cases, merge() has a problem in R-2.0.0 alpha (2004-09-14):
> 
>    x <- structure(c("a", "b", "2", "0.2-26", "O", "O"), .Dim = c(2, 3),
>      .Dimnames = list(c("1", "2"), c("P", "V", "2")))
> 
>    y <- structure(c("a", "b", "2", "0.2-25", "O", "O"), .Dim = c(2, 3),
>      .Dimnames = list(c("1", "2"), c("P", "V", "1")))
> 
>    merge(x, y, all.y=TRUE)
> 
> Error in "[<-"(`*tmp*`, ri, value = NULL) :
>          incompatible types
> 
> 
> Looks like the NA handling has changed anywhere.

Peter was right.  rbind.data.frame had

                ## copy names if any
                names(value[[jj]])[ri] <- names(xj)

but did not test if there were any.  It would probably be a good idea if 
that did work but for now I have added a test.

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] Bug in merge() in R-2.0.0 alpha
Prof Brian Ripley