How to substring the following vector (in data frame b) >b a 11 12 1234 1245 124567 126786 145769
such that: a1 a2 1 1 1 2 12 23 12 34 124 567 126 787 145 769 I tried logical commands with substr() did not work out. ______________________________________________ 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.