Skip to content
Prev 236774 / 398500 Next

vectorizing problem

try this:

GPL <- data.frame(x = c(2315100, 2315106),
     y = c("NR_024005,NR_024004,AK093685", "DQ786314"))

sp <- strsplit(as.character(GPL$y), ",")
ni <- sapply(sp, length)
data.frame(x = rep(GPL$x, ni), y = unlist(sp))


I hope it helps.

Best,
Dimitris
On 10/4/2010 7:54 PM, Dylan Miracle wrote: