merge.data.frame bug report (PR#8676)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

merge.data.frame bug report (PR#8676)

todd-24
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel