Dear R users, I have this problem with memory i guess AA<-array(rep(0,96096000),dim=c(16,5,3003,400)) Error: cannot allocate vector of size 733.2 Mb can anyone help me, Thanks in advance... [[alternative HTML version deleted]]
It depends a bit on your setup, but you could have a look at ?memory.size or ?memory.limit and see if any of that helps Jessi On 05.11.2012, at 12:49, Haris Rhrlp wrote:> Dear R users, > > I have this problem with memory i guess > > AA<-array(rep(0,96096000),dim=c(16,5,3003,400)) > Error: cannot allocate vector of size 733.2 Mb > > can anyone help me, > Thanks in advance... > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
What size system are you running on? (physical memory) What version of R are you using (32 or 64 bit)? If 32-bit, then the array you are trying to allocate requires 733MB of physical memory and there is not sufficient memory available. Do you have other large objects allocated that you might have to remove? Your best bet would be to use the 64-bit version and get at least 4 GB of memory if you are going to be working with objects that large. (my rule of thumb is that you need at least 4X the largest object you want to work with). On Mon, Nov 5, 2012 at 6:49 AM, Haris Rhrlp <haris_r_help at yahoo.com> wrote:> Dear R users, > > I have this problem with memory i guess > > AA<-array(rep(0,96096000),dim=c(16,5,3003,400)) > Error: cannot allocate vector of size 733.2 Mb > > can anyone help me, > Thanks in advance... > [[alternative HTML version deleted]] > > > ______________________________________________ > 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. >-- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.
Dear R users, BB1<-array(rep(0,14400),dim=c(16,5,12,15))> > for (i in 2:13) {+ BB1[,,(i-1),1]<-BB[,,i] + }> > > length<-rep(0,15) > CC<-array(rep(0,1200),dim=c(16,5,15)) > n<-12 > l<-0 > > fun1 <- function(x, y){+ all(sapply(seq_len(nrow(x)), function(i) + identical(x[i,], y[i,]) || identical(x[i,], -y[i,]))) + }> fun2 <- function(x, y){+ all(sapply(seq_len(ncol(x)), function(i) + identical(x[,i], y[,i]) || identical(x[,i], -y[,i]))) + }> > > for (j in 2:15) {+ + l<-l+1 + length[l]<-n + + n<-0 + + for (i in 2:length[l]) { + if (fun1(BB1[,,1,(j-1)],BB1[,,i,(j-1)])==FALSE) { + + n<-n+1 + BB1[,,n,j]<-BB1[,,i,(j-1)] + CC[,,j]<-BB1[,,1,(j-1)] + + } + } + } Error in y[i, ] : incorrect number of dimensions when i put in BB1 numbers where (j-1) is this work perfectly [[alternative HTML version deleted]]
Seemingly Similar Threads
- Swap rows and columns in a matrix
- changing the signs in rows or columns in matrices and check them if they are identical
- multiply each row in a matrix with the help of the for loop
- i want to put the results of the list in a for loop
- Selected matrices of an array and put into a list