[Rd] merge.data.frame bug report (PR#8676)

todd@baileywick.plus.com todd at baileywick.plus.com
Mon Mar 13 00:11:45 CET 2006


Merging data frames with no by variables does not append suffixes to  
column names to keep them unique.  Also, shouldn't by=NULL be a  
legitimate way to get the "Cartesian product" of two data frames,  
instead of getting the error message "'by' must specify columns"?

 > df=data.frame(col=1:3)
 > merge(df,df,by=numeric(0))
   col col
1   1   1
2   2   1
3   3   1
4   1   2
5   2   2
6   3   2
7   1   3
8   2   3
9   3   3
 >

 > merge(df,df,by=NULL)
Error in fix.by(by.x, x) : 'by' must specify column(s)
 >

 > sessionInfo()
R version 2.2.1, 2005-12-20, powerpc-apple-darwin7.9.0

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"
[6] "datasets"  "base"
 >

 > version
          _
platform powerpc-apple-darwin7.9.0
arch     powerpc
os       darwin7.9.0
system   powerpc, darwin7.9.0
status
major    2
minor    2.1
year     2005
month    12
day      20
svn rev  36812
language R
 >


Best,
Todd Bailey



More information about the R-devel mailing list