Scales for plotting ACS data with ggplot2
Usage
scale_x_acs_estimate(name = "Estimate", ..., labels = scales::label_comma())
scale_y_acs_percent(
name = "Est. % of total",
...,
labels = scales::label_percent()
)
scale_x_acs_percent(
name = "Est. % of total",
...,
labels = scales::label_percent()
)
scale_y_acs_estimate(name = "Estimate", ..., labels = scales::label_comma())
scale_x_acs_ts(name = "Year", ..., breaks = NULL, survey = "acs5", year = 2021)
scale_y_acs_ts(name = "Year", ..., breaks = NULL, survey = "acs5", year = 2021)
Arguments
- name
The name of the scale. Used as the axis or legend title. If
waiver()
, the default, the name of the scale is taken from the first mapping used for that aesthetic. IfNULL
, the legend title will be omitted.- ...
Other arguments passed on to
scale_(x|y)_continuous()
- labels
One of:
NULL
for no labelswaiver()
for the default labels computed by the transformation objectA character vector giving labels (must be same length as
breaks
)An expression vector (must be the same length as breaks). See ?plotmath for details.
A function that takes the breaks as input and returns labels as output. Also accepts rlang lambda function notation.
- breaks
One of:
NULL
for no breakswaiver()
for the default breaks computed by the transformation objectA numeric vector of positions
A function that takes the limits as input and returns breaks as output (e.g., a function returned by
scales::extended_breaks()
). Also accepts rlang lambda function notation.
- survey
ACS survey, "acs5", "acs3", or "acs1".
- year
Based on the year and survey,
acs_survey_ts()
returns a vector of years for non-overlapping ACS samples to allow comparison.