censusGeography: Census Geography

Description Usage Arguments Value Examples

View source: R/main.R

Description

Census Geography

Usage

1
2
censusGeography(dataset, type = c("city", "stateFIP", "stateICP", "region",
  "birthplace"))

Arguments

dataset

Enter a list, dataframe, or single number, that is the code for a geographic area from the United States Census

type

Choose which geographic level the code is connected with. Options are city, state FIP code, state ICP code, region, and birthplace.

Value

Dataframe of two columns. The first column is the name of the location, the second column is the location code (same as the input). If no match, will return NA as location name

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
census_city_codes <- c(210, 2489, 5350, 1330)
censusGeography(census_city_codes, type = "city")

# Input can be character type too
census_city_codes <- c("210", "2489", "5350", "1330")
censusGeography(census_city_codes, type = "city")

censusGeography(42, type = "region")

# If no match is found, will return NA for location name
censusGeography(0, type = "region")

census_stateFIP_code <- data.frame(c(1,2,4), c("test", "test2", "test3"))
names(census_stateFIP_code) <- c("code", "character_type_column")
censusGeography(census_stateFIP_code$code, type = "stateFIP")

censusGeography documentation built on May 2, 2019, 2:45 a.m.