On Sun, 7 Jan 2001, Samir Mishra wrote:
Help!
I have a very large data file with about 100 columns. Instead of loading
all of the columns using read.table() (my PC won't be able to handle the
resulting data frame), I'd like to read in one column of the datafile at
a time using scan() in conjunction with the 'what = ' option. I've tried
loading just the third column using -
scan(file.name, what = list(NULL, NULL, "", rep(NULL, 97)). ... )
along with a couple of other options but I can't get the results I want
(if I avoid an error). For example -
list(NULL, NULL, "", rep(NULL, 97))
[[1]]
NULL
[[2]]
NULL
[[3]]
[1] ""
[[4]]
NULL
is not what i'm looking for.
Is there a better way to selectively read in individual columns from a tab
separated data file?
I've done this before, and that makes this exercise even more frustrating.
Try
scan(file.name, what = list(, , ""), flush = TRUE)