powered by
Check if objects have expected length
validateIsOfLength(object, nbElements)
An object or a list of objects
number of elements that are supposed in object
If validations are successful, NULL is returned. Otherwise, error is signaled.
NULL
# 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