search for: verybigmatrix

Displaying 1 result from an estimated 1 matches for "verybigmatrix".

2011 Sep 27
0
A very big matrix inside a function
...fine the matrix before the function is called (as soon as the dimension can be calculated) R can allocate it. The problem is that although my function can use the matrix, cannot modify it. The schema is the following: # OPTION 1 # Function definition Myfunction<-function(parameters, ...) { ... Verybigmatrix<-matrix(0, n, n) # Matrix definition inside the function ... } # Main process ... Value.returned<-Myfunction(parameters, ...) # R issues an error message " Cannot allocate vector of size 6.7 Gb" ... # OPTION 2 # Function definition... Myfunction<-function(parameters, ...) { .....