On Fri, Feb 5, 2010 at 9:29 AM, jim holtman <[email protected]> wrote:
> Does this help:
>
>> x <-
>> c("1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12")
>> y <- strsplit(x, '[.]')
Here's another way with the stringr package:
library(stringr)
x <-
c("1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12")
y <- str_split_fixed(x, '[.]', 4)
y[, 1]
y[, 2]
Hadley
--
http://had.co.nz/
______________________________________________
[email protected] 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.