[R] What is the maximum limit for an array?

Ben Bolker bbolker at gmail.com
Fri Jul 12 15:42:39 CEST 2013


Jonsson <amen.alyaari <at> Bordeaux.inra.fr> writes:

> 
> Hello All,
> I am having a problem with this:
> 
> file<-array(dim=c(1440,720,700,3))
>       Error in array(dim = c(1440, 720, 700, 3)) : 
>        'dim' specifies too large an array
> 
> I have a memory of 20GB, But I do not know where is the problem!Any help
> 
> When I replaced 700 by any number bellow like( 600,500),it worked without
> any problem.

From

http://stat.ethz.ch/R-manual/R-devel/library/base/html/LongVectors.html :

Prior to R 3.0.0, all vectors in R were restricted to at most 2^31 - 1 

> 1440*720*700*3
[1] 2177280000
> 2^31-1
[1] 2147483647

  So you need R>=3.0.0 (on a 64-bit system).

 Ben Bolker



More information about the R-help mailing list