isOfLength: Check if the provided object has 'nbElements' elements

View source: R/error-checks.R

isOfLengthR Documentation

Check if the provided object has nbElements elements

Description

Check if the provided object has nbElements elements

Usage

isOfLength(object, nbElements)

Arguments

object

An object or a list of objects

nbElements

number of elements that are supposed in object

Value

TRUE if the object or all objects inside the list have nbElements.

Note

Only the first level of the given list is considered.

Examples

df <- data.frame(x = c(1, 2, 3))
isOfLength(df, 1)
isOfLength(df, 3)

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