[R] very large data set: min, max works but range fails

George Ostrouchov ostrouchovg at ornl.gov
Wed Jan 29 06:52:07 CET 2003


I want to do a simple histogram for a very large data set.  I traced the 
problem to the range() function and the storage.mode()<-"double" 
assignment.

Below is a sequence that works for min() and max(), but fails for range().

 > length(evap0)         
[1] 51812400            
 > mode(evap0)           
[1] "numeric"           
 > storage.mode(breaks)  
[1] "double"            
 > min(evap0)            
[1] -2.254886e-05       
 > max(evap0)            
[1] 0.0002331886        
 > range.default(evap0)                            
Error: vector memory exhausted (limit reached?)     
 > Error: vector memory exhausted (limit reached?)   
 > Error: vector memory exhausted (limit reached?)   

I traced it to a parameter recursion in c() within range.default()
x <- c(..., recursive = TRUE)

I am running on a linux box with 8G memory, and
VENDOR=intel  
OSTYPE=linux  
MACHTYPE=i386 
R : Copyright 2002, The R Development Core Team
Version 1.6.1  (2002-11-01)                    

I was able to do the histogram by removing the offending pieces of 
hist.default(). But I do not have an explanation for the above failure. 
I didn't find any plausible explanation in the archives.
Can someone help?

Thanks!
George

---------------------------------------------
George Ostrouchov
Statistics and Data Sciences
Computer Science and Mathematics
Oak Ridge National Laboratory




More information about the R-help mailing list