as_census_region_list: Convert a (suitably filtered) data frame from...

Description Usage Arguments Examples

View source: R/cancensus.R

Description

Convert a (suitably filtered) data frame from list_census_regions to a list suitable for passing to get_census.

Usage

1

Arguments

tbl

A data frame, suitably filtered, as returned by list_census_regions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
library(dplyr, warn.conflicts = FALSE)

# Query the CensusMapper API for the total occupied dwellings
# of 20 random Census Subdivisions, in Census 2016.
regions <- list_census_regions("CA16") %>%
  filter(level == "CSD") %>%
  sample_n(20) %>%
  as_census_region_list()

occupied <- get_census("CA16", regions = regions,
                            vectors = c("v_CA16_408"),
                            level = "Regions")

## End(Not run)

cancensus documentation built on Feb. 4, 2018, 5:02 p.m.