get_msa_data: Get Dataframe of Matching Metropolitan Area Codes

Description Usage Arguments Details Value Examples

Description

This function returns a dataframe with MSA data for a vector of Latitudes and Longitudes in a dataframe.

Usage

1
get_msa_data(Latitude, Longitude, year = 2016)

Arguments

Latitude

vector of Latitudes

Longitude

Vector of Longitudes

Details

The package operates by matching Lat/Long to shapefiles of Metropolitan and Micropolitan Statistical Areas - from CBSA files. Then, the package matches Lat/Long that have not yet been coded to Metropolitan and Micropolitan NECTAS

It returns a dataframe with the following components: GEOID: The GEOID of the MSA or NECTA NAME_LSAD: The Name of the MSA or NECTA LSAD: A Code indicating whether it is a Metro or Micro MSA or NECTA -M1 are Metropolitan MSAs -M2 are Micropolitan MSAs -M5 are Metropolitan NECTAS -M6 are Micropolitan NECTAS Source: A constructed variable, indicating if the boundaries were based on NECTA or MSAs

Value

A datafame with associated MSA info. Will be in correct order as original Lat/Long to make it easy to append the data

Examples

1
2
3
msas<-get_msa_data(NEA$CoLatitude, NEA$CoLongitude)
NEA$MSA_GEOID<-msa$csba_GEOID
NEA$MSA_NameLSAD<-msa$cbsa_NameLSAD

gmellon/neaR documentation built on May 14, 2019, 2:42 p.m.