[R] memory.size help

dxc13 dxc13 at health.state.ny.us
Fri Aug 31 14:27:58 CEST 2007

I keep getting the 'memory.size' error message when I run a program I have
been writing.  It always it cannot allocate a vector of a certain size.  I
believe the error comes in the code fragement below where I have multiple
arrays that could be taking up space.  Does anyone know a good way around

w1 <- outer(xk$xk1, data[,x1], function(y,z) abs(z-y))
w2 <- outer(xk$xk2, data[,x2], function(y,z) abs(z-y))
w1[w1 > d1] <- NA
w2[w2 > d2] <- NA
i1 <- ifelse(!is.na(w1),yvals[col(w1)],NA)
i2 <- ifelse(!is.na(w2),yvals[col(w2)],NA)
zk <- numeric(nrow(xk))      #DEFININING AN EMPTY VECTOR TO HOLD ZK VALUES
for(x in 1:nrow(xk)) {
	k <- intersect(i1[x,], i2[x,])
	zk[x] <- mean(unlist(k), na.rm = TRUE)
xk$zk <- zk
data <- na.omit(xk)
View this message in context: http://www.nabble.com/memory.size-help-tf4359846.html#a12425401
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list