Re: [R] alternate storage options

2007-12-20 Thread Moshe Olshansky
You can use a loop... If x,y and z are your vectors containing Nx,Ny and Nz numbers respectively, then for (Ix in 1:Nx) for (Iy in 1:Ny) for (Iz in 1:Nz) { Point <- c(x[Ix],y[Iy],z[Iz]) do whatever you need with Point } A (probably better) compromise may be: a <- matrix(0,nrow = Ny*Nz, ncol = 3)

[R] alternate storage options

2007-12-20 Thread dxc13
useR's. I am working with an algorithm in which I will need to create combinations of all the points I have in a matrix. When I have 2 variables, I simply use expand.grid() to do this. Sometimes I am faced with 3 or more variables and if I run expand.grid(), R cannot process it due to the huge