[R] break up a string into strings with a fixed length

Stefan Th. Gries stgries at gmail.com
Fri Oct 2 18:27:36 CEST 2009


This should do what you want:

x<-"abcdefghijkl"
strsplit(x, "(?<=...)", perl=T)

HTH,
STG
--
Stefan Th. Gries
-----------------------------------------------
University of California, Santa Barbara
http://www.linguistics.ucsb.edu/faculty/stgries




More information about the R-help mailing list