eiCompare (version 3.0.0)

latlong2fips: Latitude-Longitude Coordinates to FIPS Geocode

Description

Converts latitude/longitude coordinates to 15-digit FIPS code. Communicates with FCC API.

Usage

latlong2fips(latitude, longitude, number)

Arguments

latitude

Numeric. Latitude coordinate.

longitude

Numeric. Longitude coordinate.

number

Numeric. Usually part of a loop index counter

Value

Character string 15-digit FIPS code corresponding to Lat/Long entry

References

https://geo.fcc.gov/api/census/block/

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# EXAMPLE: NOT RUN #
# census_block <- list()
# num_catch <- rep(NA, nrow(nom_geo))

# for (i in 1:nrow(nom_geo)) {

#  census_block[[i]] <- latlong2fips(nom_geo$lat[i], nom_geo$lon[i], i)
# }

# Row Bind the list into a data.frame object #
# fips_df <- rbindlist(census_block)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab