more_than | R Documentation |
This function facilitates a comparison to check if more than a specified
proportion or count of values in a logical vector evaluate to TRUE
.
more_than(logical_vec, p = NULL, n = NULL, na.rm = FALSE)
logical_vec |
A logical vector. |
p |
Proportion value (0 to 1) to compare against. |
n |
Count value (integer) to compare against. |
na.rm |
Logical. Should missing values be removed before calculation? |
TRUE
if the condition is met for more than the specified
proportion or count, otherwise FALSE
.
Other basic_quantifiers:
at_least()
,
at_most()
,
exactly_equal()
,
less_than()
# Check if more than 70% of values are TRUE
more_than(c(TRUE, TRUE, FALSE, TRUE), p = 0.7) # Returns TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.