Skip to contents

select_acs_cols() is a wrapper for dplyr::select() designed to select the appropriate columns for a gt table created with gt_acs(). Set any named parameter to NULL to drop the respective column or use the additional ... parameter to modify the selection.

Usage

select_acs_cols(
  data,
  ...,
  name_col = "NAME",
  column_title_col = "column_title",
  value_cols = c("estimate", "moe"),
  perc_value_cols = c("perc_estimate", "perc_moe"),
  denominator_start = "denominator",
  keep_denominator = FALSE
)

Arguments

data

Input data table

obj:<data.frame>|obj:<tbl_df> // required

A data.frame object or a tibble (tbl_df).

...

Additional parameters passed to dplyr::select()

name_col, column_title_col, value_cols, perc_value_cols

ACS data column names to select using tidyselect::any_of(). Set any parameter to NULL to avoid selecting columns.

denominator_start

Passed to starts_with() to drop denominator columns. Defaults to "denominator"

keep_denominator

If FALSE (default), drop all columns that start with the text from denominator_start