This function facilitates a comparison to check if the proportion or count of values in a logical vector is exactly equal to a specified value.
Arguments
- 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?
Value
TRUE
if the proportion or count of values is exactly equal to
the specified value, otherwise FALSE
.
Examples
# Check if all values are TRUE
exactly_equal(c(TRUE, TRUE, TRUE), p = 1.0) # Returns TRUE
#> [1] TRUE