chart_annual_by: Charting Annual Data

chart_annual_byR Documentation

Charting Annual Data

Description

Please don't use in production code yet! Thank you! The pollutant-faceting feature of chart_annual_emissions_by(), in particular, may change.

chart_annual_quantities_by() is the workhorse function. It will auto-detect the first variable in data that ends with _qty, unless you supply an explicit qty_var. It relies on a default scale_x_annual(), which you can tweak by supplying year_breaks, year_limits, and/or year_expand. You can use it to chart arbitrary annual quantities, like cf_qty (control factors), ef_qty (emission factors), or fee_qty (fees).

chart_annual_emissions_by() is a specialized variant. It expects to find ems_qty and ems_unit in data. It relies on scale_y_emissions() for the y-axis, and displays both quantities and units in flagged values. It also facets the resulting chart by pollutant, relying on pol_abbr by default.

chart_annual_throughputs_by(...) tries to avoid double-counting. If there are variables beginning with pol_ or ems_ in your data, it will first issue a warning. Then, it will try to replace data with something very much like distinct(data, year, ..., tput_qty, tput_unit).

chart_annual_growth_by() is a specialized variant. Like chart_annual_quantities_by(), it will try to find a variable ending with _qty in your data, unless you supply an explicit qty_var. It relies on scale_y_percentage() for the y-axis, and formats flagged values using format_percent_change().

Usage

chart_annual_control_factors_by(data, ...)

chart_annual_emission_factors_by(data, ...)

chart_annual_emissions_by(data, ...)

chart_annual_growth_by(data, ..., base_year)

chart_annual_quantities_by(data, ...)

chart_annual_throughputs_by(data, ...)

Arguments

data

tabular, with a column year

...

variables to chart by. Must be present in data.

geom

"line", "point", "col", or "area"

year_limits

like CY(1990, 2040)

year_breaks

like seq(1990, 2050, by = 10)

year_expand

see ggplot2::expansion()

flag_years

if provided, will display actual values at these years.

flag_labels

controls the information displayed in flags. See glue::glue().

base_year

required for chart_annual_growth(); optional otherwise. Displays a mark at the corresponding year.

title

passed to ggplot2::labs()

subtitle

passed to labs()

caption

passed to labs()

verbose

display messages

Functions

  • chart_annual_control_factors_by(): Chart annual control factors.

  • chart_annual_emission_factors_by(): Chart annual emission factors.

  • chart_annual_emissions_by(): Chart annual emissions.

  • chart_annual_growth_by(): Chart annual growth, relative to some base year.

  • chart_annual_quantities_by(): Chart an arbitrary annual quantity.

  • chart_annual_throughputs_by(): Chart annual throughputs.

Note

In chart_annual_growth_by(), base_year serves to index the reference year for normalization.


BAAQMD/ggtools documentation built on Feb. 8, 2023, 6:22 p.m.