exclude_missing: Exclude missing datapoints

exclude_missingR Documentation

Exclude missing datapoints

Description

Exclude datapoints that are NA, NULL or NaN.

Usage

exclude_missing(x, .NA = T, .NULL. = T, .NaN = T, .Inf = T)

Arguments

x

(an interatable object) An object to subset based on missingness.

.NA

(logical scalar) Whether to exclude NA (default TRUE).

.NaN

(logical scalar) Whether to exclude NaN (default TRUE).

.NULL

(logical scalar) Whether to exclude NULL (default TRUE).

Details

Does not remove NA etc. recursively. See the complex list example.

Examples

x = list(1, NA, 2, NULL, 3, NaN, 4, Inf)
exclude_missing(x)
exclude_missing(x, .NA = F)
exclude_missing(x, .NULL = F)
exclude_missing(x, .NaN = F)
exclude_missing(x, .Inf = F)
#complex list
x = list(1, NA, 2, NULL, 3, NaN, 4, Inf, 1:3, c(1, NA, 3))
exclude_missing(x) #does not remove NAs recursively

Deleetdk/kirkegaard documentation built on Feb. 28, 2025, 5:04 p.m.