tag:blogger.com,1999:blog-1275149608391671670.post77689602905415745..comments2023-09-28T06:13:40.704-04:00Comments on SAS and R: Example 8.26: reading data with variable number of words in a fieldKen Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-1275149608391671670.post-14520306282699606352011-02-23T14:38:35.265-05:002011-02-23T14:38:35.265-05:00file <- readLines("http://www.math.smith.e...file <- readLines("http://www.math.smith.edu/r/data/ella.txt")<br />file <- gsub("^([0-9]* )(.*),( .*)$","\\1'\\2'\\3",file)<br />tc <- textConnection(file)<br />processed <- read.table(tc,sep=" ",na.string="---")<br />close(tc)Anonymousnoreply@blogger.com