On Thu, Jun 3, 2010 at 4:06 PM, Wu Gong <w...@mtmail.mtsu.edu> wrote: > > Hope it helps. > > text <- "var1 var2 > 9G/G09 abd89C/T90 > 10A/T9 32C/C > 90G/G A/A" > > x <- read.table(textConnection(text), header = T)
Or with the stringr package: library(stringr) str_match(x$var1, "(.)/(.)") Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ ______________________________________________ R-help@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.