Query the CensusMapper API for available vectors for a given dataset.

list_census_vectors(dataset, use_cache = TRUE, quiet = TRUE)

Arguments

dataset

The dataset to query for available vectors, e.g. "CA16".

use_cache

If set to TRUE (the default), data will be read from a local cache that is maintained for the duration of the R session, if available. If set to FALSE, query the API for the data, and refresh the local cache with the result.

quiet

When FALSE, shows messages and warnings. Set to TRUE by default.

Value

Returns a data frame detailing the available Census vectors (i.e. variables) for a given Census dataset. This data frame has columns vector containing the short code for the variable, type describing whether it's a female, male, or total aggregate, label indicating the name of the variable, units indicating whether the value represents a numeric integer, percentage, dollar figure, or ratio, parent_vector to show hierarchical relationship, aggregation indicating whether the value is additive or a transformation, and a column details with a detailed description of the variable generated by traversing all labels within its hierarchical structure.

Examples

# List all vectors for a given Census dataset in CensusMapper list_census_vectors('CA16')
#> # A tibble: 6,623 x 7 #> vector type label units parent_vector aggregation details #> <chr> <fct> <chr> <fct> <chr> <chr> <chr> #> 1 v_CA16… Total Population… Numb… <NA> Additive CA 2016 Census; … #> 2 v_CA16… Total Population… Numb… <NA> Additive CA 2016 Census; … #> 3 v_CA16… Total Population… Numb… <NA> Average of … CA 2016 Census; … #> 4 v_CA16… Total Total priv… Numb… <NA> Additive CA 2016 Census; … #> 5 v_CA16… Total Private dw… Numb… v_CA16_404 Additive CA 2016 Census; … #> 6 v_CA16… Total Population… Ratio <NA> Average of … CA 2016 Census; … #> 7 v_CA16… Total Land area … Numb… <NA> Additive CA 2016 Census; … #> 8 v_CA16… Total Total - Age Numb… <NA> Additive CA 2016 Census; … #> 9 v_CA16… Male Total - Age Numb… <NA> Additive CA 2016 Census; … #> 10 v_CA16… Female Total - Age Numb… <NA> Additive CA 2016 Census; … #> # … with 6,613 more rows