[R] Substring a column vector

Peter Maclean pmaclean2011 at yahoo.com
Thu Jul 7 05:41:02 CEST 2011


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.



More information about the R-help mailing list