powered by
This function checks if a numeric value is a proportion scalar, meaning it is numeric and within the range of 0 to 1 (inclusive).
is_proportion(x)
TRUE if x is a proportion, otherwise FALSE.
TRUE
x
FALSE
Numeric value to check.
is_integerlike, is_count, validate_proportion, validate_count
is_integerlike
is_count
validate_proportion
validate_count
is_proportion(0.5) # TRUE is_proportion(1.2) # FALSE is_proportion(-0.2) # FALSE
Run the code above in your browser using DataLab