Tell me more ×  I have a csv file with a few million lines. Each
line can have lengths between 5 and 10. I can use read.table()
to read in the data by padding out each row to length 10 with
NAs or empty strings, however, removing these NAs later is time
consuming. I would like to read the file into a list of vectors,
so that each line can have it's own list element, negating the
need for padding the rows with NAs or empty strings.
share|improve this question add comment  1 Answer  up vote 3
down vote accepted  You can use readLines() with strsplit():
test <- strsplit(readLines("MyFile.csv"),",") share|improve this
answer Brilliant, thanks. Don't know why that didn't occur to
me. –  Bill Beesley Jun 25 at 12:30 add comment  Your Answer