Liaw, Andy <andy_liaw <at> merck.com> writes:
: > I do not want that empty character in the beginning, but
: > couldn't figure out
: > how to strip the starting white spaces, other than something
: > ugly like:
: >
: > > strsplit(sub("^ +", "", " a b c "), " +")
: > [[1]]
: > [1] "a" "b" "c"
:
: Looks like there's no easier way than to strip the spaces before
: splitting the fields.
Here is a way to split it up without first stripping away leading spaces:
scan(textConnection(" a b c "), what = "")
______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html