
Sunburst plot of indicator outcomes for one category, bay segment, and year
Source:R/plot_category.R
plot_category.RdSunburst plot of indicator outcomes for one category, bay segment, and year
Usage
plot_category(
...,
bay_segment,
yr,
bay_segments = c("OTB", "HB", "MTB", "LTB"),
yr_min = 2000,
wt = NULL
)Arguments
- ...
named data.frames, passed to
anlz_category. See its documentation (andanlz_indicators) for the expected shape- bay_segment
chr string, single bay segment to plot, must be one of
bay_segments- yr
integer, single year to plot
- bay_segments
chr vector of bay segments to include, passed to
anlz_category, defaults toc('OTB', 'HB', 'MTB', 'LTB')- yr_min
integer, minimum year to include, passed to
anlz_category, defaults to2000- wt
named numeric vector of indicator weights, passed to
anlz_category
Details
Calls anlz_category on ... to get both the
per-indicator outcomes (one wide column per indicator) and the overall
category score for bay_segment/yr, then plots a two-ring
sunburst using a colored center for the category's overall
outcome and an outer ring with one equal-size wedge per
indicator colored by that indicator's own outcome. Both rings use the
same continuous red/yellow/green outcome scale, and an indicator missing
for bay_segment/yr still gets an equal-size wedge, rendered
gray rather than dropped. Thematically identical to
plot_score, which extends this same two-ring layout with a
third ring combining several categories.
Examples
plot_category(
wq_attain = data.frame(bay_segment = 'OTB', yr = 2020, outcome = 0.8),
fib = data.frame(bay_segment = 'OTB', yr = 2020, outcome = 0.4),
bay_segment = 'OTB', yr = 2020
)