This function checks whether the input is proper proportion, i.e., a single
numeric
between 0 and 1.
Usage
is_proportion(x, error = TRUE)
Arguments
- x
Any object.
- error
In the case that x
is not a proper proportion, either TRUE
(default) to throw an error or FALSE
to return invisibly FALSE
.
Value
If error = TRUE
, either invisibly TRUE
or an error is thrown.
If error = FALSE
, invisibly TRUE
or FALSE
.