Re: [Rd] Merge (PR#9699)

From: <edward.m_at_psu.ac.th>
Date: Mon, 28 May 2007 15:30:52 +0200 (CEST)


Yes, it appears to have been resolved in R2.5.0pat, although the counter-example provided *does* fail in R2.5.0.

A <- data.frame(x=1:3, y=4:6, y=7:9, check.names=FALSE) B <- data.frame(x=1:3, a=3:1)
A
  x y y
1 1 4 7
2 2 5 8
3 3 6 9
B
  x a
1 1 3
2 2 2
3 3 1
merge(A, B)
  x y y.1 a
1 1 4 4 3
2 2 5 5 2
3 3 6 6 1

---

Prof Brian Ripley wrote:

> On Mon, 21 May 2007, edward.m@psu.ac.th wrote:
>
>> Full_Name: Edward McNeil
>> Version: 2.5.0
>> OS: Windows XP
>> Submission from: (NULL) (203.170.234.5)
>>
>>
>> This is a new bug introduced to R2.5.0.
>>
>> Scenario: If one of the data frames to merge contains two variables
>> that have
>> the same name, then the data in first variable (of the same name) is
>> copied to
>> the second variable in the resulting merged data frame.
>
> This is probably
>
> o <a data.frame>[i, j] could sometimes select the wrong column
> when j is numeric if there are duplicate column names.
>
> from NEWS and hence already fixed in R-patched.
>
>> In R2.4.1, the second variable name is automatically renamed (in the
>> resulting
>> data frame) by adding ".1" to the end. R2.5.0 doesn't seem to do this
>> anymore.
>
> This is not reproducible:
>
> A <- data.frame(x=1:3, y=4:6, y=7:9, check.names=FALSE)
> B <- data.frame(x=1:3, a=3:1)
> merge(A, B)
>
> works correctly in R-patched. You were asked for a reproducible
> example: if you have one in current R-patched, please supply it now
> (using PR#9699 early in your subject line).
>
>
-- This message has been scanned for viruses and\ dangerous con...{{dropped}} ______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 28 May 2007 - 21:21:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 May 2007 - 21:34:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.