clean.na {cwhmisc} | R Documentation |
clean.na
Eliminate rows or columns containing NA.
clean.na(x,margin,drop=FALSE)
x |
A matrix. |
margin |
= 1 for rows, = 2 for columns |
drop |
= FALSE (default) if result should be a matrix even if it contains only one row or column. |
The matrix without the offending rows or columns.
Christian W. Hoffmann <c-w.hoffmann@sunrise.ch>
http://www.wsl.ch/personal_homepages/hoffmann/index_EN
drop
.
x <- matrix(c(1,NA,2,5),2,2) clean.na(x,1) # [,1] [,2] #[1,] 1 2 clean.na(x,2,TRUE) # [1] 2 5