Skip to content
Prev 42819 / 63424 Next

merge bug fix in R 2.15.0

Hi,

I'm not sure I follow ... I think we're in total agreement, but it
sounds like you're suggesting we aren't.

On Sun, Mar 18, 2012 at 4:40 PM, Peter Meilstrup
<peter.meilstrup at gmail.com> wrote:
[snip]
I agree, that is confusing -- where did this happen?
Total agreement here.
But it didn't "still use '.x'" ... it didn't do anything.

There was a column name in the original table that ended with '.x' and
it wasn't changed since the call to merge asked for a blank suffix.
These were the two data.frames, for reference:

d1 <- data.frame(a=letters[1:10], b=rnorm(10), b.x=tail(letters, 10))
d2 <- data.frame(a=letters[1:10], b=101:110)

If you had those two data.frames, and you did this:

merge(d1, d2, by='a', suffixes=c("", ".y")

How is the following result surprising?

   a           b b.x b.y
1  a -1.52250626   q 101
2  b -0.99865341   r 102
...
I agree that the rule should be simple. I'm not sure why asking for a
blank ("") suffix somehow isn't simple.
What was "the surprising name change" you are referring to?

-steve