with_hierarchy: Annotate tabular data with hierarchical headings

with_hierarchyR Documentation

Annotate tabular data with hierarchical headings

Description

Join hierarchy to input_data, yielding additional columns ending in h1, h2, h3, etc.

Usage

with_hierarchy(
  input_data,
  using = NULL,
  depth = NULL,
  ...,
  warn_missing = FALSE,
  verbose = getOption("verbose")
)

Arguments

input_data

tabular data

using

tabular data, OR the name of a .CSV file found in ⁠BY2015/Hierarchies/⁠.

depth

(integer) use at most this many levels

warn_missing

(logical) warn if any records in input_data do not have a match in using

verbose

(logical)

Details

  • There must exist key column(s) in input_data (e.g. cat_id or pol_id) matching the key column(s) in using.

  • If using is a filename/path, then import_hierarchy() will be used to import, tidy, reshape, and validate it.

Note

For historical reasons, with_hierarchy() effectively defaults to with_category_hierarchy(using = t1327).

See Also

  • inventory::with_category_hierarchy()

  • inventory::with_pollutant_hierarchy()

  • inventory::with_SIC_hierarchy() and the OSHA SIC system (search)

  • inventory::with_SCC8_hierarchy(), with_SCC8_hierarchy(), and the EPA SCC system (search)


BAAQMD/tbltools documentation built on Feb. 29, 2024, 5:45 a.m.