Monday, July 25, 2011

reading numeric data from a string variable in R

use textConnection :

strin_var = readLines(textfle)
tc=textConnection(string_var)
df = read.table(tc,colClasses="numeric")


http://www.r-bloggers.com/example-8-27-using-regular-expressions-to-read-data-with-variable-number-of-words-in-a-field/

No comments:

Post a Comment