[R] Question regarding subsetting

From: Dennis Fisher <fisher_at_plessthan.com>
Date: Fri 22 Jul 2005 - 20:45:15 EST

I run R 2.1.1 in a Linux environment (RedHat 9) although my question is not platform-specific.

Consider the following:
> A <- c("Prefix-aaa", "Prefix-bbb", "Prefix-ccc")
> B <- strsplit(A, "-")
> B

[[1]]
[1] "Prefix" "aaa"

[[2]]
[1] "Prefix" "bbb"

[[3]]
[1] "Prefix" "ccc"

How do I extract the elements "aaa", "bbb", "ccc" from B?

Thanks in advance.

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.com

        [[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 Received on Fri Jul 22 20:49:23 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:55 EST