is_list: Check if the passed entity is a list.

View source: R/list.R

is_listR Documentation

Check if the passed entity is a list.

Description

Check if the passed entity is a list.

Usage

is_list(l, required_names = NULL, exact_length = NULL, allow_null = FALSE)

Arguments

l

the value to check

required_names

vector of strings. If passed, checks if the list contains *at least* the specified elements.

exact_length

integer value. If passed, the list must have the *exact* specified length

allow_null

if TRUE, NULL is accepted as a valid value. If FALSE (default) do not accept it.

Details

Note that a list with names set to NULL are considered not to be present. This is an R detail, not a qscheck detail.

Examples

## Not run: 
# For assertion
assertthat::assert_that(qscheck::is_list(my_parameter))
# For check
if (qscheck::is_list(my_parameter)) {}

## End(Not run)



AstraZeneca/qscheck documentation built on Nov. 1, 2023, 4:45 a.m.