On Thu, 2003-11-06 at 20:24, John Fox wrote: > Dear Ben and Mark, > > substring and substr are also helpful here. > > John
Quite true. As usual, there is usually more than one way to do things. The above approach, given the C code, would be faster as the source vector and the offsets of the substring increase in size. This would become more influential if you want the resultant characters as a single substring as opposed to a vector of the characters, which my initial solution would yield. > unlist(strsplit("testing", ""))[2:5] [1] "e" "s" "t" "i" > substr("testing", 2, 5) [1] "esti" Thanks John. Marc ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help