[R] Question about a passage in R language

Sébastien Durier sdurier.stat at gmail.com
Fri Dec 11 22:09:50 CET 2015


Hello,

In ?Extract, one can read "An empty index selects all values: this is 
most often used to replace all the entries but keep the attributes"
No example is given but if x a vector I interpret this sentence as 
"x[]". And in fact, all attributes seem to be preserved by this indexing.
But in the R language manual 
(https://cran.r-project.org/doc/manuals/r-devel/R-lang.html#Indexing-by-vectors), 
the following passage puzzles me : "Empty. The expression x[] returns x, 
but drops “irrelevant” attributes from the result." I must misunderstand 
something because it sounds contradictory with the help page.

Thank you

SD



More information about the R-help mailing list