removeNa | R Documentation |
Remove rows and columns containing only NA values
removeNa(object, ...)
## S4 method for signature 'DFrame'
removeNa(object)
## S4 method for signature 'Matrix'
removeNa(object)
## S4 method for signature 'atomic'
removeNa(object)
## S4 method for signature 'data.frame'
removeNa(object)
## S4 method for signature 'matrix'
removeNa(object)
object |
Object. |
... |
Additional arguments. |
Sanitized object.
Updated 2021-10-14.
## atomic ====
removeNa(c("hello", "world", NA))
removeNa(c(1, 2, NA))
## matrix ====
from <- matrix(
data = c(1, NA, 3, NA, NA, NA, 2, NA, 4),
nrow = 3,
ncol = 3
)
print(from)
to <- removeNa(from)
print(to)
## DFrame ====
from <- S4Vectors::DataFrame(
"a" = c("A", NA, "C"),
"b" = c(NA, NA, NA),
"c" = c("B", NA, "D")
)
print(from)
to <- removeNa(from)
print(to)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.