Thanks, both of these methods work great!
Dimitris Rizopoulos-4 wrote:
>
> one way is:
>
> mat <-
> matrix(c(rep(NA,10),1,2,3,4,5,6,7,8,9,10,10,9,8,NA,6,5,4,NA,2,1,rep(NA,10),1,2,3,4,NA,6,7,8,9,10),
>
> 10, 5)
> ind <- colSums(is.na(mat)) != nrow(mat)
> mat[, ind]
>
>
> I hope it helps.
>
Dear dxc13,
Here is another way:
index <- apply(mat, 2, function(x) !all(is.na(x)))
mat[ , index]
HTH,
Jorge
On Sun, May 24, 2009 at 12:53 PM, dxc13 wrote:
>
> useR's,
> I have a matrix given by the code:
> mat <-
>
> matrix(c(rep(NA,10),1,2,3,4,5,6,7,8,9,10,10,9,8,NA,6,5,4,NA,2,1,rep(NA,10)
one way is:
mat <-
matrix(c(rep(NA,10),1,2,3,4,5,6,7,8,9,10,10,9,8,NA,6,5,4,NA,2,1,rep(NA,10),1,2,3,4,NA,6,7,8,9,10),
10, 5)
ind <- colSums(is.na(mat)) != nrow(mat)
mat[, ind]
I hope it helps.
Best,
Dimitris
dxc13 wrote:
useR's,
I have a matrix given by the code:
mat <-
matrix(c(rep(NA,1
3 matches
Mail list logo