Learn R Programming

MazamaLocationUtils (version 0.2.0)

location_getCensusBlock: Get census block data from the FCC API

Description

The FCC Block API is used get census block, county, and state FIPS associated with the longitude and latitude. The following list of data is returned:

  • stateCode

  • county

  • censusBlock

The data from this function should be considered to be the gold standard for state and county. i.e. this information could and should be used to override information we get elsewhere.

Usage

location_getCensusBlock(longitude = NULL, latitude = NULL, verbose = TRUE)

Arguments

longitude

Single longitude in decimal degrees E.

latitude

Single latitude in decimal degrees N.

verbose

Logical controlling the generation of progress messages.

Value

List of census block/county/state data.

References

https://geo.fcc.gov/api/census/#!/block/get_block_find

Examples

Run this code
# NOT RUN {
library(MazamaLocationUtils)

lon <- -77.51
lat <- 38.26

censusList <- location_getCensusBlock(lon, lat)
str(censusList)
# }

Run the code above in your browser using DataLab