Description Usage Arguments Value
Function that checks length of x. It may throw a stop(), warning(), and/or repeat the variable to create the desired length.
1 2 | CheckLength(x, len, hard.stop = TRUE, warn.single = FALSE,
par.name = character())
|
x |
object to check/adjust length of |
len |
desired length of object |
hard.stop |
if TRUE, stop when length(x) is neither 1 nor len. else, throw a warning and use repeat() to adjust length of x. |
warn.single |
if TRUE, through a warning when length(x) is 1 and it is being extended to a new length. |
par.name |
Character, used in the warning or stop message to indicate which parameter this warning is meant for. |
x updated to have length len, or throws exception
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.