I would like to split a string into words at its blanks but also to preserve 
all blanks.

Example:
        c(" some    words to split ") 
should become
        c(" ", "some", "   ", " words", " ", "to" , " ", "split", " ")

I was not able to achieve this via strsplit() .
But I am not familiar with regular expressions.
Is there an easy way to do that using e.g. regex and strsplit?

Thanks
Mark
–––––––––––––––––––––––––––––––––––––––
Mark Heckmann
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com

______________________________________________
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.

Reply via email to