[R] Error in matrix: too many elements specified

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Nov 12 12:07:07 CET 2008

On Wed, 12 Nov 2008, Diego Liechti wrote:

> Dear all,
> I run the 64 bit version of R under ubuntu 8.10.  I have a dual core
> machine with 5 GB RAM.  Further, I increased virtual memory with a
> swapfile to 90 GB.
> If I run a program which uses large matrixes, I get the following error
> message:  "Error in matrix:  too many elements specified".
> Is there a possibility to increase the possible size of a matrix?

No.  See ?"Memory-limits".

However, you would need a lot more than 5GB of RAM (say 64GB) for R to run 
comfortably with the size of object you are trying to create (16GB for a 
real-valued matrix).  One day when the R developers are using such systems 
we will begin to address the issue (but it will require a lot of work by 
package maintainers if we do).  I think it was three years ago I 
estimated that point as being five years away -- and 64-bit versions of R 
are still a small minority.

> Many thanks and best wishes,
> Diego
> 	[[alternative HTML version deleted]]

PLEASE do as you were asked in the posting guide and send well-formated 
plain text only.  I've deleted tens of unneeded blank lines in your 
posting which did not even fit on one screen.

> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list