Query the CensusMapper API for vectors with descriptions matching a searchterm.

search_census_vectors(searchterm, dataset, type = NA, ...)

Arguments

searchterm

The term to search for e.g. "Ojibway". Search terms are case insensitive. If unable to find a given search term, this function will suggest the correct spelling to use when possible.

dataset

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

type

One of NA, 'Total', 'Male' or 'Female'. If specified, only return variables of specified `type`.

...

Further arguments passed on to list_census_vectors.

Examples

search_census_vectors('Ojibway', 'CA16')
#> # A tibble: 24 x 7 #> vector type label units parent_vector aggregation details #> <chr> <fct> <chr> <fct> <chr> <chr> <chr> #> 1 v_CA16… Total Ojibway-… Numb… v_CA16_569 Additive CA 2016 Census; 100… #> 2 v_CA16… Male Ojibway-… Numb… v_CA16_570 Additive CA 2016 Census; 100… #> 3 v_CA16… Female Ojibway-… Numb… v_CA16_571 Additive CA 2016 Census; 100… #> 4 v_CA16… Total Ojibway Numb… v_CA16_617 Additive CA 2016 Census; 100… #> 5 v_CA16… Male Ojibway Numb… v_CA16_618 Additive CA 2016 Census; 100… #> 6 v_CA16… Female Ojibway Numb… v_CA16_619 Additive CA 2016 Census; 100… #> 7 v_CA16… Total Ojibway-… Numb… v_CA16_1376 Additive CA 2016 Census; 100… #> 8 v_CA16… Male Ojibway-… Numb… v_CA16_1377 Additive CA 2016 Census; 100… #> 9 v_CA16… Female Ojibway-… Numb… v_CA16_1378 Additive CA 2016 Census; 100… #> 10 v_CA16… Total Ojibway Numb… v_CA16_1424 Additive CA 2016 Census; 100… #> # … with 14 more rows
# NOT RUN { # This will return a warning that no match was found, but will suggest similar terms. search_census_vectors('Ojibwe', 'CA16', 'Total') # }