[R] First elements of a list.

From: cory <nipps85_at_gmail.com>
Date: Wed 30 Aug 2006 - 00:17:56 EST


Suppose I have the following list:

a <- strsplit(c("John;Smith", "Jane;Doe", "koda", "gunner"), ";")

I want to get to these two vectors without looping...

firstNames: c("John", "Jane", "koda", "gunner") lastNames: c("Jane", "Doe", NA, NA)

Thanks

cn

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch 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 Wed Aug 30 01:38:17 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 30 Aug 2006 - 02:26:47 EST.

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