Skip to content
Prev 388515 / 398513 Next

problem for strsplit function

On 09/07/2021 6:44 p.m., Bert Gunter wrote:
?"[[" gives you the same page, but I agree:  this part of the 
documentation isn't written very clearly. The "Introduction to R" manual 
uses the terms I used (see section 2.7, "Index vectors; selecting and 
modifying subsets of a data set"), as does the source code (and the R 
Language Definition manual, though it's not as clear as the Intro).

But the point isn't to chastise you, it's to educate you (and the OP). 
Thinking of [] as subsetting is more helpful than thinking of it as 
extraction.  That way the result of x[c(1,2)] makes sense.  It's a 
little bit more of a stretch, but the result of x[[c(1,2)]] also makes 
sense when you think of it as extraction.

Duncan Murdoch

  The relevant part of the