[R] Large Stata file Import in R

Thomas Lumley tlumley at u.washington.edu
Tue Jun 30 19:18:44 CEST 2009


On Tue, 30 Jun 2009, Xavier wrote:

> saurav pathak vas escriure el dia dl, 29 jun 2009:
>
>> Hi
>>
>> I am using Stata 10 and I need to import a data set in stata 10 to R, I have
>> saved the dataset in lower versions of Stata as well by using saveold
>> command in Stata.
>>
>> My RAM is 4gb and the stata file is 600MB, I am getting an error message
>> which says :
>>
>> "Error: cannot allocate vector of size 3.4 Mb
>> In addition: There were 50 or more warnings (use warnings() to see the first
>> 50)"
>>
>> Thus far I have already tried the following
>
> Maybe it does not adress the R problem that you are asking for, but you can
> try to "compress" the stata file prior to save it. And maybe the size of
> the file will decrease.
>

This can't possibly help.  The problem is that *R* is running out of memory, and storing the data elements in less space *on disk* won't help with the space used in memory.  Stata's -compress- option just chooses smaller data types, eg, byte instead of integer.

    -thomas


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list