is_vector: Checks if the passed entity is a vector. Note that in R...

View source: R/vector.R

is_vectorR Documentation

Checks if the passed entity is a vector. Note that in R single values are also vectors.

Description

Checks if the passed entity is a vector. Note that in R single values are also vectors.

Usage

is_vector(value, exact_length = NULL, min_length = NULL, max_length = NULL)

Arguments

value

The value to check

exact_length

integer. If passed, checks if the vector is of the *exact* specified length.

min_length

integer. If passed, checks if the vector length is at least the specified length, inclusive. Note: if exact_length is specified, this parameter is ignored

max_length

integer. If passed, checks if the vector length is at most the specified length, inclusive Note: if exact_length is specified, this parameter is ignored

Examples

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

## End(Not run)


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