vadr (version 0.01)

dots_missing: Detect missing arguments in link... arguments

Description

These are useful for writing functions that accept any number of arguments but some may be missing. For example, arrays in R can have any number of dimensions, indexed by the [ function, where a missing argument means to take all indexes on that dimension. However there is not a good way to replicate ['s behavior in base R; using list(...) to collect all positional arguments will throw errors on missing arguments. Instead, use x <- list_missing(...) and is.missing(x) to detect missing arguments.

For ... objects as made by dots, performs this check without forcing evaluation.

Usage

dots_missing(...)
list_missing(...)
is.missing(x)

Arguments

...
for dots_missing, any number of arguments, each being checked for missingness, without being evaluated.
x
If given a list, compares each element with the missing value. Given a dots object, determines whether each argument is empty or missing.

Value

For dots_missing, a logical vector.For list_missing, a named list of all evaluated arguments, where any missing arguments are set to missing_value().For is.missing, a vector of boolean values.

See Also

missing_value