-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
It would be nice to be able to check if a vector is of a required length (exact, min or max). The scalar checkers check_name()
, check_string()
etc., ensure an object is of length 1, but being able to check length constraints > 1 would be helpful. I could see this being implemented as something like:
check_length(x, ..., length, arg = caller_arg(x), call = caller_env())
where length
could be either a scalar integer value to specify an exact required length, or a length 2 vector supplying an allowed range of lengths (which could include -Inf
or Inf
if only a minimum or maximum length is required).
Alternatively, a length
argument could be added to the vector checkers such as check_character()
and check_logical()
.
olivroy
Metadata
Metadata
Assignees
Labels
No labels