Description Usage Arguments Value Examples
Remove NA
s from vector or matrix
1 2 3 4 5 6 7 8 9 10 11 |
x |
a vector or matrix |
... |
further arguments passed to methods |
margin |
if |
keep |
if |
If x
is a matrix and margin
is 1 or 2, a matrix is returned.
Else a vector.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | m1 <- matrix(c(10, 20, 30, 43,
10, NA, 32, 50,
NA, NA, NA, NA,
13, 22, 70, 81,
NA, 29, NA, 41), 5, byrow=TRUE,
dimnames=list(letters[1:5], LETTERS[1:4]))
narm(m1)
matplot(narm(apply(m1, 2, sort, na.last=TRUE)), type="l")
m1[complete.cases(m1),]
narm(m1, 1, "c") #same
narm(m1, 2, "complete") #no complete columns
m1.df <- as.data.frame(t(m1))
narm(m1.df, 2, "complete")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.