Adds reportable = coverage >= kappa to the result of coverage_sql(). A pair below the floor
is not reportable: the caller deletes its zone-metric row, so it is excluded from the
composite exactly as a component with no cells is – it is never published as a zero.
Arguments
- d
data frame with a numeric
coveragecolumn (typically fromcoverage_sql()).- kappa
numeric in
[0, 1]; the floor, default0.05(5 %).- tol
numeric; absolute tolerance on the boundary comparison, default
1e-9.
Details
The boundary is inclusive and is compared with a tolerance, because the fraction arrives from a
floating-point division: 5 of 100 equally weighted cells must be reportable at kappa = 0.05,
and whether 5/100 lands a half-ulp below 0.05 depends on the weights that produced it.
Examples
coverage_floor(data.frame(zone_seq = 1:2, metric_key = "m", coverage = c(0.04, 0.05)))
#> zone_seq metric_key coverage reportable
#> 1 1 m 0.04 FALSE
#> 2 2 m 0.05 TRUE