census_get_data: Get StatsCan Census Data for Specified Regions

View source: R/census.R

census_get_dataR Documentation

Get StatsCan Census Data for Specified Regions

Description

This function provides an interface to Statistics Canada's 2016 Census geographies Web Data Service (WDS) and returns some or all Census Profile data for a geography of interest. Data is returned for individual regions specified by Dissemination Geography Unique Identifiers (or DGUIDs), which can correspond to census regions like dissemination areas, political regions like provinces and territories, or economic regions.

NOTE: This function is under active development, and it is my intention to turn it into a properly "tidy" function.

For more details on the underlying API, please see StatsCan's documentation here:

Usage

census_get_data(dguids = NA, topic = 0, notes = 0, stat = 0, lang = "E")

Arguments

dguids

A character vector or one-column dataframe containing the DGUIDs to query. Note: in a future version this will be made "tidier."

topic

Which subset of census data should be returned? The following values are accepted;

  • 0 = All topics (default)

  • 1 = Aboriginal peoples

  • 2 = Education

  • 3 = Ethnic origin

  • 4 = Families, households and marital status

  • 5 = Housing

  • 6 = Immigration and citizenship

  • 7 = Income

  • 8 = Journey to work

  • 9 = Labour

  • 10 = Language

  • 11 = Language of work

  • 12 = Mobility

  • 13 = Population

  • 14 = Visible minority

notes

Should footnotes be returned? 0 = no (default), 1 = yes.

stat

What statistic should be returned? 0 = counts (default), 1 = rates.

lang

Language "EN" or "FR" (FIXME confirm!)

Details

Note: This function is under active development. Please send suggestions or bug reports to christopher.a.belanger (at) gmail.com.

Value

data

Examples

## Not run: 
# get mobility data for Ottawa and Leeds & Grenville, Census Divisions 3506 &
3507.
onsr::census_make_dguid(data = c("3506", "3507"),
                       geouid_type = "CDUID",
                       vintage_year = 2016) %>%
onsr:::census_get_data(topic = 12)

## End(Not run)

Ottawa-Neighbourhood-Study/onsr documentation built on June 19, 2022, 11:46 a.m.