[R] --mem-vsize in R

Uwe Ligges ligges at statistik.tu-dortmund.de
Mon May 2 12:02:50 CEST 2011



On 29.04.2011 22:14, kparamas wrote:
> Hi,
>
> I am calculation pairwise correlation coefficient for a matrix of 234 X
> 30000.
> I am getting the following error,
> Error in cbind(as.vector(row(cl)), as.vector(col(cl)), as.vector(cl)) :
>    allocMatrix: too many elements specified


The problem is that you try to create a matrix with 3 * nrow(cl) * 
ncol(cl) elements here. The maximal number of elements in one single 
vector or matrix is 2^31 - 1. You can have several of those, if you have 
a sufficient amount of RAM, tough.

Uwe Ligges




> In addition: There were 50 or more warnings (use warnings() to see the first
> 50)
>
> The function used is,
> corGraphPearson = function(cData, COR) #COR is threshold 0.5,0.7, etc
> {
>
>      cl = unname(cor(cData, use="pairwise.complete.obs", method="pearson"))
>
>          result = cbind(as.vector(row(cl)),as.vector(col(cl)),as.vector(cl))
>          result = result[result[,1] != result[,2],]
>
>          corm = result
>
> # remove low cor pairs
>          corm =corm[abs(corm[,3])>= COR, ]
> # the network
>          net<- network(corm, directed = F)
> }
>
>
> I am running this in a cluster with 4 machines with 24 GB memory each.
>
> How should I start R so that I make max use of the memory availbale?
> Or how to overcome this issue?
>
> --
> View this message in context: http://r.789695.n4.nabble.com/mem-vsize-in-R-tp3484541p3484541.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.



More information about the R-help mailing list