left-joining to empty data.frame yields NAs instead of empty data.frame #48

Closed
HarlanH opened this Issue Jun 30, 2011 · 0 comments

Comments

Projects
None yet
2 participants

HarlanH commented Jun 30, 2011

Using plyr 1.5.2:

aa <- data.frame(aa=1:3, bb=4:6)
bb <- data.frame(aa=1:10, cc=20:29)
join(aa,bb)
join(subset(aa,subset=aa==0), bb)

For the last line, I get:

Joining by: aa
   aa bb cc
1  NA NA NA
2  NA NA NA
3  NA NA NA
4  NA NA NA
5  NA NA NA
6  NA NA NA
7  NA NA NA
8  NA NA NA
9  NA NA NA
10 NA NA NA
Warning message:
In data.frame(..., check.names = FALSE) :
  row names were found from a short variable and have been discarded

I was expecting to get an empty dataframe back.

Thanks!

@hadley hadley closed this in c6cc206 Oct 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment