Checks length of an object is within bounds.
check_length( x, min_length = 1L, max_length = max_integer(), x_name = substitute(x) )
x | The object to check. |
---|---|
min_length | A count of the minimum length. |
max_length | A count of the maximum length. |
x_name | A string of the name of the object. |
Throws an informative error or returns an invisible copy of the object.
#> Error : 1:2 must be at least of length 3