Skip to contents

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. If NULL, the legend title will be omitted.

...

Other arguments passed on to scale_(x|y)_continuous()

labels

One of:

  • NULL for no labels

  • waiver() for the default labels computed by the transformation object

  • A 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:

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.