validityLength: Validate if proper length

validityLengthR Documentation

Validate if proper length

Description

Check that a vector x is of specified length (value) and return an error otherwise.

Usage

validityLength(x, value, name)

Arguments

x

an R object. For replacement, a vector or factor.

value

a non-negative integer or double (which will be rounded down).

name

variable name to return in the error message

Value

Return TRUE if the condition is respected and an error otherwise.

Examples

x <- c(1,2,3)
validityLength(x, 3, name = "w")
validityLength(x, 4, name = "w")


aleblancbio/timescale documentation built on Aug. 27, 2022, 3:01 p.m.