removeNa: Remove rows and columns containing only NA values

removeNaR Documentation

Remove rows and columns containing only NA values

Description

Remove rows and columns containing only NA values

Usage

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)

Arguments

object

Object.

...

Additional arguments.

Value

Sanitized object.

Note

Updated 2021-10-14.

Examples

## 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)

acidgenomics/brio documentation built on Feb. 1, 2024, 11:47 a.m.