Learn R Programming

ospsuite.utils (version 1.2.0)

validateIsOfLength: 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

Run this code
# NOT RUN {
# returns `NULL` if of objects are of specified length
validateIsOfLength(list(1, 2), 2L)

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

Run the code above in your browser using DataLab