Skip to contents

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.

Usage

coverage_floor(d, kappa = 0.05, tol = 1e-09)

Arguments

d

data frame with a numeric coverage column (typically from coverage_sql()).

kappa

numeric in [0, 1]; the floor, default 0.05 (5 %).

tol

numeric; absolute tolerance on the boundary comparison, default 1e-9.

Value

d with a logical reportable column added.

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