You havn't said anithing about your OS and version. But basicly I means, that you don't have enoigh RAM or swap memory aviable on your system. How large dataset you have?
1. You can optimise your code. :) or 2. You can just add more RAM to your system, or you can add more swap space on your HDD. Work with data in swap will be really slow. In linux OS you can add additional swap space, by these commmands: 2 GB file: dd if=/dev/zero of=/swapfile1 bs=1024 count=2097152 mkswap /swapfile1 swapon /swapfile1 On Friday 31 August 2007 15:27:58 dxc13 wrote: > 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) -- Andris Jankevics Assistant Department of Medicinal Chemistry Latvian Institute of Organic Synthesis Aizkraukles 21, LV-1006, Riga, Latvia ______________________________________________ R-help@stat.math.ethz.ch 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.