On 02/02/2009 6:45 PM, David Epstein wrote:
I'm sure I've read about the difference between a[[i]] and a[i] in R, but I
cannot recall what I read. Even more disturbing is the fact that I don't
know how to search the newsgroup for this. All the different combinations I
tried were declared not to be valid search syntax.

1. What sort of object can the operators [] and [[]] be applied to? How do
they differ? I mean objects in standard R, not in packages that provide
conceivable overloading of these operators (if that's possible).

They both apply to vectors. [] gives you a subset of the vector, [[]] gives you an element. (For most vectors an element is returned as a subset of length 1, but for a list object, the element is different from a list containing it.)

2. Meta-question: how could one search for an answer to this question in the
newsgroup?
3. Meta-question: how could one search for an answer to this in the FAQ?
4. Meta-question: how could one search for an answer to this in any of the
links one is shown after typing help.start()?

You forgot to ask: which manual describes this? (The Intro to R, the R Language Definition both do.)

You could also try help("[[") for some useful info.

Duncan Murdoch

Thanks for any help.
David

______________________________________________
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