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.

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@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.

Reply via email to