validityLength | R Documentation |
Check that a vector x
is of specified length (value
) and return an error otherwise.
validityLength(x, value, name)
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 |
Return TRUE
if the condition is respected and an error otherwise.
x <- c(1,2,3) validityLength(x, 3, name = "w") validityLength(x, 4, name = "w")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.