validateIsOfLength: Check if objects have expected length

View source: R/validation-helpers.R

validateIsOfLengthR Documentation

Check if objects have expected length

Description

Check if objects have expected length

Usage

validateIsOfLength(object, nbElements)

Arguments

object

An object or a list of objects

nbElements

number of elements that are supposed in object

Value

If validations are successful, NULL is returned. Otherwise, error is signaled.

Examples

# returns `NULL` if of objects are of specified length
validateIsOfLength(list(1, 2), 2L)

# error otherwise
# validateIsOfLength(c("3", "4"), 3L)

ospsuite.utils documentation built on March 18, 2022, 6:44 p.m.