conversionTables: Pull list of conversion tables

View source: R/dbConvert.R

conversionTablesR Documentation

Pull list of conversion tables

Description

Pull a list of all conversion tables. Conversion tables represent the proportional relationship ("split") between source and destination geographies, and are named as Table-FROM-TO-YEAR. For example, the table that converts from LHA to SD based on 2019 matches is called Table-LHA-SD-2019. (Historical APL naming was similar, but had the word TABLE before the year (e.g., LHA-SD-TABLE2019).)

Conversion tables are in the "I:/ConversionTables/" folder, to ensure consistency across population systems, and because dbConvert uses that hardcoded path to find the required conversion table. Conversion tables are expected to be .xlsx files with three unnamed columns with the proportional relationship (aka, "split"), source and destination geographies.

Usage

conversionTables(geog = NULL, year = NULL)

Arguments

geog

A character vector of one or more geographies to list. Default = NULL. If NULL, all conversion tables will be listed. If not NULL, only those conversion tables with that geog(s) as either Source or Destination geography will be listed.

year

A vector of one or more years of conversion tables to list. Default = NULL. If NULL, all conversion tables will be listed. If not NULL, only those conversion tables of that Year(s) will be listed.

Value

A data.frame object with variables: Table, Source, Destination, and Year.

See Also

Overall package documentation: dbutils()

Other conversion helpers: conversionRead(), dbConvert(), geogConvert()

Examples

conversionTables()                          ## lists all conversion tables
conversionTables(geog = NULL, year = NULL)  ## lists all conversion tables
conversionTables(geog = c("RD", "HA"))      ## lists only select conversion tables
conversionTables(year = "2020")             ## lists only 2020 conversion tables
conversionTables(year = c(2020, 2021))      ## lists only select conversion tables

bcgov/dbutils documentation built on Sept. 30, 2022, 12:04 a.m.