[R] Minor Bug in Documentation of merge()

Duncan Murdoch murdoch at stats.uwo.ca
Fri Jul 25 20:19:14 CEST 2008


On 7/25/2008 2:13 PM, Roland Rau wrote:
> Dear all,
> 
> I would like to point to a minor bug in the documentation of merge().
> 
> The documentation (?merge) says
> all	logical; all = L is shorthand for all.x = L and all.y = L.
> 
> I think the correct description should be
> all	logical; all = T is shorthand for all.x = T and all.y = T.

I think it is correct; it says that all = TRUE is the same as all.x=TRUE 
and all.y=TRUE, and all=FALSE is the same as all.x=FALSE and all.y=FALSE.

Duncan Murdoch

> 
> The source file which needs to be fixed is
> src/library/base/man/merge.Rd
> 
> To be sure that it hasn't been fixed in the meantime, I checked the 
> merge.Rd in R-patched_2008-07-24.tar.gz and R-devel_2008-07-24.tar.gz.
> 
> Thanks,
> Roland
> 
> Little code example:
> 
>  > set.seed(12345)
>  > df.A <- data.frame(Year=2000:2004, myvar.A=rnorm(5))
>  > df.B <- data.frame(Year=1998:2002, myvar.B=rnorm(5))
>  > merge(df.A, df.B, all=L)
> Error in merge.data.frame(df.A, df.B, all = L) : object "L" not found
>  > merge(df.A, df.B, all=T)
>    Year    myvar.A    myvar.B
> 1 1998         NA -1.8179560
> 2 1999         NA  0.6300986
> 3 2000  0.5855288 -0.2761841
> 4 2001  0.7094660 -0.2841597
> 5 2002 -0.1093033 -0.9193220
> 6 2003 -0.4534972         NA
> 7 2004  0.6058875         NA
>  >
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list