prop: Calculate Proportion of TRUE Values in a Logical Vector
Description
This function calculates the proportion of TRUE values in a logical
vector.
Usage
prop(logical_vec, na.rm = FALSE)
Value
The proportion of TRUE values in the logical vector.
Arguments
logical_vec
A logical vector.
na.rm
Logical. Should missing values be removed before calculation?
Behaves similar to base::mean, removing missing values
from both the numerator and denominator of the proportion
calculation.