Skip to content
Prev 10317 / 398503 Next

memory allocation error

"M. Edward (Ed) Borasky" <znmeb at aracnet.com> writes:
(See Brian's post on the memory options)

R does have a rather bad habit of expanding data when they are loaded
into memory by storing into 8 byte doubles etc. Some even worse
inflation takes place during read.table (et al.) processing. In your
case, you seem to be able to read one file but not the second so you
might hope that both would actually fit when converted and try
something like

x<-read.csv(...)
save(x,file="filex")
rm(x)
y<-read.csv(...)
save(y,file="filey")
rm(y)
...

load("filex")
load("filey")

A more interesting option is to set up an ODBC connection to the
Access database and use the RODBC package, which should allow you to
select on columns, etc. You can even do that to your CSV file
(slightly tricky, I have only tried it once and it took a while to
figure out that you need to set up the ODBC connection to be to the
*directory* containing the text file(s)).

[Anyone for implementing a columns= option for scan() and read.xxx() ??]