AddCensusDemographics: Add Census demographics data to your simple features object

Description Usage Arguments Value

Description

Add Census demographics data to your simple features object

Usage

1
2
AddCensusDemographics(map, year = 2010, state, county = NULL,
  demographicvars = NULL, api_key = NULL)

Arguments

map

A simple features map covering a part of one (and only one) state.

year

The Census year from which you want data.

state

The state that contains map. Accepts FIPS code and two letter abreviation.

county

The FIPS code of the county/counties containing map. This defaults to NULL, but the function runs more quickly the fewer counties downloaded.

demographicvars

The demographic variables you want to add. If NULL (the default) it downloads the total population which is "P0010001" for 2010 and "P001001" for 1990 and 2000. Codes can be looked up at https://api.census.gov/data.html by clicking on "variables" next to the Census year you want.

api_key

Your census API key. Works with NULL (default), but you are subject to limits without a key.

Value

A new simple features object with U.S. Census demographic data added.


stmacdonell/AddCensus documentation built on May 13, 2019, 12:20 p.m.