Re: [R] indexing

From: Erik Iverson <iverson_at_biostat.wisc.edu>
Date: Wed, 26 Mar 2008 21:02:13 -0500

I find R books to be helpful for beginners. There is a fairly comprehensive list on the R web site, www.r-project.org.

Is this what you had in mind though? Without example code, it's hard for me to tell exactly your situation.

test <- list(first = c("string1a", "string2a"), second = c("string1b", "string2b"))
sapply(test, "[[", 1)

Best,
Erik Iverson

gbr0wn_at_comcast.net wrote:
> Is there an on-line source that explains index vectors? I used
> 'strsplit' to generate a lengthy list of pairs of character vectors.
> I only want the first of each pair. Brackets, double brackets, and
> '$' operator don't work [[alternative HTML version deleted]]
>
> ______________________________________________ R-help_at_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.



R-help_at_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. Received on Thu 27 Mar 2008 - 02:05:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 27 Mar 2008 - 02:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive