removeNA: Remove rows and columns containing only NA values

Description Usage Arguments Value Note Examples

Description

Remove rows and columns containing only NA values

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
removeNA(object, ...)

## S4 method for signature 'atomic'
removeNA(object)

## S4 method for signature 'matrix'
removeNA(object)

## S4 method for signature 'Matrix'
removeNA(object)

## S4 method for signature 'data.frame'
removeNA(object)

## S4 method for signature 'DataFrame'
removeNA(object)

Arguments

object

Object.

...

Additional arguments.

Value

Sanitized object.

Note

Updated 2019-10-12.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## 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)

## DataFrame ====
from <- DataFrame(
    a = c("A", NA, "C"),
    b = c(NA, NA, NA),
    c = c("B", NA, "D")
)
print(from)
to <- removeNA(from)
print(to)

acidgenomics/pipette documentation built on Sept. 27, 2021, 9:10 a.m.