View source: R/utils-typechecks.R
is_proportion | R Documentation |
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)
x |
Numeric value to check. |
TRUE
if x
is a proportion, otherwise FALSE
.
is_integerlike
, is_count
,
validate_proportion
, validate_count
is_proportion(0.5) # TRUE
is_proportion(1.2) # FALSE
is_proportion(-0.2) # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.