[Rd] Small bug in the documentation of `[.data.frame`
ru|pb@rr@d@@ @end|ng |rom @@po@pt
Tue Dec 29 18:54:30 CET 2020
Thank you both, Duncan and Martin, for the quick and clear answer.
I hadn't considered printing `[.data.frame`, which is in fact very
useful, but I had read the Arguments section. What I didn't realize was
that it was the answer to the question. Sorry for the noise.
Às 13:51 de 29/12/20, Martin Maechler escreveu:
>>>>>> Duncan Murdoch
>>>>>> on Tue, 29 Dec 2020 08:37:51 -0500 writes:
> > On 29/12/2020 8:29 a.m., Rui Barradas wrote:
> >> Hello,
> >> R 4.0.3 on Ubuntu 20.10, session info at end.
> >> Isn't the default value of argument drop missing in
> >> ?`[.data.frame`
> >> Usage:
> >> ## S3 method for class 'data.frame'
> >> x[i, j, drop = ]
> >> I had the impression that it was TRUE (it is when running the function,
> >> I'm talking about the docs).
> > No, you can see it if you print `[.data.frame`:
> >> `[.data.frame`
> > function (x, i, j, drop = if (missing(i)) TRUE else length(cols) ==
> > 1)
> > So if you ask for specific rows and your dataframe has more than one
> > column, it defaults to FALSE.
> > I think the Rd checks allow you to leave out defaults, but don't allow
> > you to state them incorrectly, so that's probably why it is left as
> > blank in the Usage section, and explained in the Arguments section.
> > Duncan Murdoch
> Yes, indeed, Duncan, it is as you think (above).
> It is "official" in the sense that we've used this for a long
> time in order to keep the 'Usage' section cleaner, when some
> defaults are sophisticated, and a help page reader should rather
> read the corresponding argument description.
> >> sessionInfo()
> >> R version 4.0.3 (2020-10-10)
> >> Platform: x86_64-pc-linux-gnu (64-bit)
> >> Running under: Ubuntu 20.04.1 LTS
> >> Matrix products: default
> >> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
> >> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
> >> locale:
> >>  LC_CTYPE=pt_PT.UTF-8 LC_NUMERIC=C
> >>  LC_TIME=pt_PT.UTF-8 LC_COLLATE=pt_PT.UTF-8
> >>  LC_MONETARY=pt_PT.UTF-8 LC_MESSAGES=pt_PT.UTF-8
> >>  LC_PAPER=pt_PT.UTF-8 LC_NAME=C
> >>  LC_ADDRESS=C LC_TELEPHONE=C
> >>  LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C
> >> attached base packages:
> >>  stats graphics grDevices utils datasets methods base
> >> loaded via a namespace (and not attached):
> >>  compiler_4.0.3 tools_4.0.3
> >> Happy holidays,
> >> Rui Barradas
> >> ______________________________________________
> >> R-devel using r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel
> > ______________________________________________
> > R-devel using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
More information about the R-devel