get_regions: Locates spatial coordinates within user-specified regions.

Description Usage Arguments Value

Description

Locates spatial coordinates within user-specified regions.

Usage

1
get_regions(df, regions, lat, long, X = NULL, Y = NULL, epsg = 4326)

Arguments

df

A data frame with lat/long or X/Y coordinates.

regions

The type of region. Options include: "CAs", "districts", "tracts", "zips", and "wards."

lat

Name of the field storing latitude. Should be in quotes.

long

Name of the field storing longitude. Should be in quotes.

X

The 'X coordinate' you find on some tables from the data portal.

Y

The 'Y coordinate' you find on some tables from the data portal. Should use EITHER lat/long or X/Y but not both.

epsg

The epsg. Only relevant if using lat/long. Default is 4326 (WSG84).

Value

A data frame. More specifically, df + one or two regional variables. If region = "CAs", the CA number and name are added. For all other regions a single field is added: 'TRACTCE10" for tracts, "DIST_NUM" for districts, and "ZIP" for zips.


dmwelgus/MapChi documentation built on May 15, 2019, 9:38 a.m.