TODO.
check_length(x, arg_length = 1L, alt_null = FALSE, add_msg = NULL)
Returns invisible NULL
when argument is of asserted length,
otherwise it will throw an error.
Function arguments that are being asserted.
Integer. Length of argument, for scalars it should take
value 1
(default).
Logical. Should argument accept NULL value.
Is an additional message that can be printed over the standard function error message. You can:
pass the names of the arguments that failed the test by using
{x_name}
in the message body (e.g. "What are the {wrong_names}");
pass the tested length by using {arg_length}
in the message body (e.g.
"I want them to be {arg_length})"
pass the lengths of the arguments that failed the test by using
{wrong_length}
in the message body (e.g. "{wrong_lengths} are wrong")