[R] Deleting columns from a matrix

dxc13 dxc13 at health.state.ny.us
Sun May 24 18:53:15 CEST 2009

I have a matrix given by the code:
mat <-

This is a 10x5 matrix containing missing values.  All columns except the
second contain missing values.  I want to delete all columns that contain
ALL missing values, and in this case, it would be the first and fourth
columns.  Any column that has at least one real number would remain. I know
I can use "mat[,-1]" to delete the first column, but I have a much larger
matrix where it is impossible to tell how many columns contain all missing
values and which don't.  
Is there a function or something else that may be able to help me accomplish

Thanks in advance.
View this message in context: http://www.nabble.com/Deleting-columns-from-a-matrix-tp23695656p23695656.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list