is_valueless: Determine whether a list or vector has any non-missing...

View source: R/data_manip_utils.R

is_valuelessR Documentation

Determine whether a list or vector has any non-missing values.

Description

A vector is "valueless" if it has zero length or contains only NA values. A list is empty if has zero length or contains only empty vectors.

Usage

is_valueless(x, empty_values = NA)

Arguments

x

The object to check for emptiness.

empty_values

A vector of values that should be considered "empty", in addition to NA. Any vector containing only NA and these values will be considered "valueless". For example, if you want to know whether a numeric vector contains any non-NA, non-zero values, you could use empty_values = 0. Another common value to use is "", the empty string.

See Also

rlang::is_empty(), which only checks for zero length.


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.