Overall bay segment score across all four indicator categories
Arguments
- wqoverall
output of
anlz_categoryfor water quality- sedoverall
output of
anlz_categoryfor sediment- fwoverall
output of
anlz_categoryfor fish/wildlife- haboverall
output of
anlz_categoryfor habitat- wt
named numeric vector of category weights, e.g.
c(wq = 2, sed = 1, fw = 1, hab = 1). Categories not named inwt(including all of them whenwt = NULL) get a weight of1, so the default is a plain unweighted mean across the four categories, passed toanlz_category.
Value
A data.frame with columns bay_segment, yr,
outcome (0-1, 1 = best, the overall Bay Segment Score),
n_indicator (number of categories with a score for that
segment/year), and one additional column per category (wq,
sed, fw, hab) holding that category's own score,
NA where a segment/year has no score for it
Details
A thin, semantically-named wrapper around
anlz_category. A category score is just another
single-indicator input, so combining the four category scores into one
bay segment score uses exactly the same stacking (anlz_indicators)
and weighted-averaging logic that combines individual indicators into a
category score.
Examples
wqoverall <- data.frame(bay_segment = 'OTB', yr = 2020, outcome = 0.8)
sedoverall <- data.frame(bay_segment = 'OTB', yr = 2020, outcome = 0.6)
fwoverall <- data.frame(bay_segment = 'OTB', yr = 2020, outcome = 0.7)
haboverall <- data.frame(bay_segment = 'OTB', yr = 2020, outcome = 0.5)
anlz_score(wqoverall, sedoverall, fwoverall, haboverall)
#> # A tibble: 1 × 8
#> bay_segment yr outcome n_indicator wq sed fw hab
#> <chr> <int> <dbl> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 OTB 2020 0.65 4 0.8 0.6 0.7 0.5
