Skip to content
Prev 30046 / 398513 Next

read.table

On Tue, 1 Apr 2003 Oldradio69 at aol.com wrote:

            
You can't use read.table.  It is designed to read a data frame where by 
definition the columns are the same length.

What you can do is to use scan and remove the NAs as in

tmp <- lapply(scan("foo.txt", list(0, 0)), function(x) x[!is.na(x)])

which will give you a list of two numeric vectors.