Re: [R] looking for one-liner for strsplit and regex

2009-04-11 Thread David Winsemius
What you have now is a list with one element which happens to be a character vector. Try: > vec <- scan(textConnection(myline)) Read 5 items > vec [1] 0.10 1.50 0.60 538.00 0.369404 -- David Winsemius On Apr 11, 2009, at 8:23 PM, Juliet Hannah wrote: Hi, I have a li

[R] looking for one-liner for strsplit and regex

2009-04-11 Thread Juliet Hannah
Hi, I have a line such as: myline <- "0.10 1.5000 0.6000 538 0.369404" and I would like to put the numbers into a vector. Some combination of tabs and spaces occur between the numbers. I tried: try1 <- strsplit(myline,"[[:blank:]]+") > try1 [[1]] [1] ""