| Title: | Lightweight Federal Information Processing System (FIPS) Code Information Retrieval |
|---|---|
| Description: | Provides a lightweight suite of functions for retrieving information about 5-digit or 2-digit US FIPS codes. |
| Authors: | Justin Singh-Mohudpur [aut, cre] (ORCID: <https://orcid.org/0000-0002-5233-5799>), Mike Johnson [ctb] (ORCID: <https://orcid.org/0000-0002-5288-8350>), Urban Flooding Open Knowledge Network (UF-OKN) [fnd] |
| Maintainer: | Justin Singh-Mohudpur <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.2.9000 |
| Built: | 2026-05-12 07:44:10 UTC |
| Source: | https://github.com/program--/fipio |
Convert a state name, abbreviation, or county name to FIPS codes
as_fips(state, county = NULL)as_fips(state, county = NULL)
state |
State names, state abbreviations, or one of the following: "all", "conus", "territories" |
county |
County names or "all" |
a character vector
fipio::as_fips(state = "California") fipio::as_fips(state = "NC") fipio::as_fips(state = "Rhode Island", county = "Washington") fipio::as_fips(c("CA", "North Carolina"), c("Stanislaus", "NEW HANOVER")) fipio::as_fips("CONUS") fipio::as_fips(state = "NC", county = "all")fipio::as_fips(state = "California") fipio::as_fips(state = "NC") fipio::as_fips(state = "Rhode Island", county = "Washington") fipio::as_fips(c("CA", "North Carolina"), c("Stanislaus", "NEW HANOVER")) fipio::as_fips("CONUS") fipio::as_fips(state = "NC", county = "all")
Associate a set of coordinates to FIPS codes
coords_to_fips(x, ...) ## S3 method for class 'sf' coords_to_fips(x, ...) ## S3 method for class 'sfc' coords_to_fips(x, ...) ## S3 method for class 'sfg' coords_to_fips(x, ...) ## S3 method for class 'list' coords_to_fips(x, ...) ## S3 method for class 'data.frame' coords_to_fips(x, coords = c(1, 2), ...) ## S3 method for class 'matrix' coords_to_fips(x, coords = c(1, 2), ...) ## S3 method for class 'character' coords_to_fips(x, y, ...) ## S3 method for class 'numeric' coords_to_fips(x, y, ...)coords_to_fips(x, ...) ## S3 method for class 'sf' coords_to_fips(x, ...) ## S3 method for class 'sfc' coords_to_fips(x, ...) ## S3 method for class 'sfg' coords_to_fips(x, ...) ## S3 method for class 'list' coords_to_fips(x, ...) ## S3 method for class 'data.frame' coords_to_fips(x, coords = c(1, 2), ...) ## S3 method for class 'matrix' coords_to_fips(x, coords = c(1, 2), ...) ## S3 method for class 'character' coords_to_fips(x, y, ...) ## S3 method for class 'numeric' coords_to_fips(x, y, ...)
x |
|
... |
Named arguments passed on to methods |
coords |
Coordinates columns if |
y |
Latitude in EPSG:4326 |
a character vector of FIPS codes
# Some coordinates at UC Santa Barbara coords_to_fips(x = -119.8696, y = 34.4184)# Some coordinates at UC Santa Barbara coords_to_fips(x = -119.8696, y = 34.4184)
Get the state abbreviation for a FIPS code
fips_abbr(fip)fips_abbr(fip)
fip |
2-digit or 5-digit FIPS code |
a character vector
fipio::fips_abbr("37") fipio::fips_abbr("06001")fipio::fips_abbr("37") fipio::fips_abbr("06001")
Get the county name for a FIPS code
fips_county(fip)fips_county(fip)
fip |
2-digit or 5-digit FIPS code |
a character vector
fipio::fips_county("37129") fipio::fips_county("06001") # 2-digit FIP codes will not work fipio::fips_county("37")fipio::fips_county("37129") fipio::fips_county("06001") # 2-digit FIP codes will not work fipio::fips_county("37")
Get the geometry for a FIPS code
fips_geometry(fip)fips_geometry(fip)
fip |
2-digit or 5-digit FIPS code |
an sfg/sfc object
## Not run: fipio::fips_geometry("37") fipio::fips_geometry("06001") ## End(Not run)## Not run: fipio::fips_geometry("37") fipio::fips_geometry("06001") ## End(Not run)
Get the metadata for a FIPS code
fips_metadata(fip, geometry = FALSE)fips_metadata(fip, geometry = FALSE)
fip |
2-digit or 5-digit FIPS code |
geometry |
If |
a data.frame
fipio::fips_metadata("37") fipio::fips_metadata("06001")fipio::fips_metadata("37") fipio::fips_metadata("06001")
Get the state name for a FIPS code
fips_state(fip)fips_state(fip)
fip |
2-digit or 5-digit FIPS code |
a character vector
fipio::fips_state("37") fipio::fips_state("06001")fipio::fips_state("37") fipio::fips_state("06001")
fipio is usingThis function is primarily for debugging purposes, or for ensuring that the correct matching function is used.
using_fastmatch()using_fastmatch()
TRUE if fastmatch::fmatch is used.