Re: [R] Huge matrix: allocation works but assignment fails

2009-10-01 Thread Uwe Ligges



Remi wrote:

Hello everyone,

I am working with one big matrix:
w=matrix(0,18000,18000)

on a Linux computer with 16Go of RAM.

I can actually create the matrix, and even access elements:
w[10,10]
0

but if I try to change one element, it fails:
w[10,10]=1


In this case your object is copied and you need two times the space for 
your object.


Best,
Uwe Ligges



Erreur : impossible d'allouer un vecteur de taille 2531250 Ko
(Failed to allocate a vector of size...)

What can I do? And, maybe even more important, how can one explains such 
a behavior?


Thank you for any help/advice

RĂ©mi Proville.

__
R-help@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.


__
R-help@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.


Re: [R] Huge matrix: allocation works but assignment fails

2009-10-01 Thread Ben Bolker
 Remi wrote:

 
  (Failed to allocate a vector of size...)
  What can I do? And, maybe even more important, how can one explains such 
  a behavior?

 If your matrices are not sparse, get more memory. If they are,

 help(sparseMatrix,package=Matrix) ?

__
R-help@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.