Re: [R] subset of string by index

2010-08-08 Thread Marc Schwartz
On Aug 8, 2010, at 9:50 AM, david h shanabrook wrote: > How can I get a substring based on the index into the string? > > strM <- c("abcde", "cdefg") > ind <- c(1,3,5) > > I want to use ind to index into the strings so the result is: > > strMind <- c("ace", "ceg") Here is one way: > apply(s

[R] subset of string by index

2010-08-08 Thread david h shanabrook
How can I get a substring based on the index into the string? strM <- c("abcde", "cdefg") ind <- c(1,3,5) I want to use ind to index into the strings so the result is: strMind <- c("ace", "ceg") __ R-help@r-project.org mailing list https://stat.ethz.c

[R] subset of string by index

2010-08-08 Thread david h shanabrook
How can I get a substring based on the index into the string? strM <- c("abcde", "cdefg") ind <- c(1,3,5) I want to use ind to index into the strings so the result is: strMind <- c("ace", "ceg") __ R-help@r-project.org mailing list https://stat.ethz.c