
Conditional value summary functions
Source:R/summary_functions.R
conditional_value_summary_functions.RdThese functions summarize only values that satisfy a threshold condition.
sum_*() returns zero when valid observations exist but none satisfy the
condition. mean_*() returns NA_real_ when no value satisfies the
condition.
Usage
sum_above(threshold, na.rm = TRUE)
sum_at_or_above(threshold, na.rm = TRUE)
sum_below(threshold, na.rm = TRUE)
sum_between(lower, upper, inclusive = TRUE, na.rm = TRUE)
mean_above(threshold, na.rm = TRUE)
mean_at_or_above(threshold, na.rm = TRUE)
mean_below(threshold, na.rm = TRUE)
mean_between(lower, upper, inclusive = TRUE, na.rm = TRUE)Arguments
- threshold
A single finite numeric threshold.
- na.rm
If
TRUE, missing values are ignored. For proportion functions, the denominator is the number of non-missing observations.- lower, upper
Single finite numeric limits.
lowermust be less than or equal toupper.- inclusive
If
TRUE, values equal to the boundary are included.