na_help: Manage 'NA' and non-'NA' values

View source: R/na.R

na_helpR Documentation

Manage NA and non-NA values

Description

All functions in this group except na0 and ok0 take objects of atomic mode, atomic dtfs, or atomic vlists.

Usage

na_help()

na(x)

ok(x)

sub_na(x, sub)

na0(x)

ok0(x)

rm_na(x)

Arguments

x

The argument to be inspected/managed.

sub

An atomic scalar to replace NA values. Mode must be compatible withx

Functions

  • na(): Logically indexes NA values of x. Returns a logical object of the same dimension as x.

  • ok(): Logically indexes non-NA values of x. Returns a logical object of the same dimension as x.

  • sub_na(): Substitutes sub for NA values ofx. Modes of x and sub must be compatible. Returns x with NA values replaced.

  • na0(): Evaluates whether x is an atomic NA scalar. Returns a logical scalar.

  • ok0(): Evaluates whether x is an atomic, non-NA scalar. Returns a logical scalar.

  • rm_na(): Removes NA values of x If there are no NA values in x, returns x unchanged. If there are NA values in x, removing them may change the dimensions and/or class of x. Returns x with NA values removed.

See Also

Other missingness: stats0_help()

Examples

egNA0 <- NA
egOK0 <- "a"
egVec <- c(egNA0, egOK0)
egMat <- sample(vec, 10, replace = T)
egMat
na(egVec)
ok(egVec)
na(egMat)
ok(egMat)
na0(egNAS)
na0(egOK0)
na0(egVec)
ok0(egOK0)
ok0(egNAS)
ok0(egVec)
sub_na(egMat, "x")
rm_na(egMat)

j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.