> #I need to get this final result > r<-data.frame(i=c(1,1,1,2,2,3), s=c(97, 98, 99, 103, 105, 118))
Nothing magic to suggest. But maybe: list.s <- strsplit(d$s,",") r <- data.frame(i=rep(d$i, times=sapply(list.s, length)), s=unlist(list.s), stringsAsFactors=FALSE ) S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.