Skip to contents

Reads the precomputed Program Area metrics from the zone_metric table instead of aggregating across cells. Returns the same shape as scores_for_cells() so it's a drop-in replacement for the score / flower-plot pipeline when the area is a Program Area.

Usage

scores_for_pra(con, pra_key, metric_pattern = "_ecoregion_rescaled$")

Arguments

con

a DBI connection (e.g. from sdm_db_con())

pra_key

Program Area key (e.g. "CGM")

metric_pattern

regex to filter metric.metric_key (default: "_ecoregion_rescaled$")

Value

tibble(metric_key, score, component, even)

Details

A component with no zone_metric row is absent, not zero: v7.1 deletes the row of a (zone, component) pair that fails the coverage floor, and a Program Area whose component has no scored cell never had one. The inner joins here preserve that — the row simply does not come back, and mean_score() averages over what is present, which is how the published composite was computed. Reportability is the ABSENCE of the _ecoregion_rescaled row, never the _prepctareaweighting row, which stays behind even for a dropped pair.