search for: dimnesions

Displaying 1 result from an estimated 1 matches for "dimnesions".

Did you mean: dimensions
2005 Jul 27
2
setting elements to NA across an array
Please excuse what is obviously a trivial matter... I have a large 3-d array. I wish to set the third dimension (z) to NA if there are any NA values in the first two dimnesions (xy). So, given array foo: foo <- array(data = NA, dim = c(5,5,3)) foo[,,1] <- matrix(rnorm(25), 5, 5) foo[,,2] <- matrix(rnorm(25), 5, 5) foo[,,3] <- matrix(rnorm(25), 5, 5) I'll set two elements to NA foo[2,2,1]<- NA foo[3,5,2]<- NA foo Now I want to set fo...