i...@whywouldwe.com wrote:
Hi
The docs for R are very practical, which is quite refreshing compared to
other languages, however I can't find any details about all the things I
can do with a vector. I'm expecting methods like vector.contains('foo')
and vector.remove('foo'), maybe those methods don't exist but I'd love
to find a page that details the ones that do.
I'd also like to find some docs about foreach loops (unless there's a
better way to iterate through a vector), I've only found mailing list posts.
There may be such a page somewhere, but it is probably incomplete. The
object model in R has methods owned by generics, not by classes. So
even if someone wrote a list of all methods that worked on vectors,
someone else could add a new one without modifying the vector class.
You can ask R what methods are currently visible, e.g.
library(methods)
showMethods(classes="vector")
but it won't show methods in unattached packages.
Duncan Murdoch
______________________________________________
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.