| Title: | Lightweight Federal Information Processing System (FIPS) Code Information Retrieval | 
| Version: | 1.1.2 | 
| Description: | Provides a lightweight suite of functions for retrieving information about 5-digit or 2-digit US FIPS codes. | 
| URL: | https://fipio.justinsingh.me, https://github.com/program--/fipio | 
| BugReports: | https://github.com/program--/fipio/issues | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.1.2 | 
| Depends: | R (≥ 3.5.0) | 
| Suggests: | testthat (≥ 3.0.0), mockery (≥ 0.4.2), covr, fastmatch (≥ 1.0.0) | 
| Config/testthat/edition: | 3 | 
| NeedsCompilation: | no | 
| Packaged: | 2024-01-22 00:22:43 UTC; jsinghm | 
| Author: | Justin Singh-Mohudpur | 
| Maintainer: | Justin Singh-Mohudpur <justin@justinsingh.me> | 
| Repository: | CRAN | 
| Date/Publication: | 2024-01-22 00:40:02 UTC | 
Simple intersection via ray casting
Description
Simple intersection via ray casting
Usage
.intersects(x, y, geometry)
Value
indices of points in x and y
that intersect geometry
Check if a point intersects with a side of a polygon
Description
Check if a point intersects with a side of a polygon
Usage
.segment_intersect(side, x, y)
Convert a state name, abbreviation, or county name to FIPS codes
Description
Convert a state name, abbreviation, or county name to FIPS codes
Usage
as_fips(state, county = NULL)
Arguments
| state | State names, state abbreviations, or one of the following: "all", "conus", "territories" | 
| county | County names or "all" | 
Value
a character vector
Examples
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
Description
Associate a set of coordinates to FIPS codes
Usage
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, ...)
Arguments
| x | 
 | 
| ... | Named arguments passed on to methods | 
| coords | Coordinates columns if  | 
| y | Latitude in EPSG:4326 | 
Value
a character vector of FIPS codes
Examples
# Some coordinates at UC Santa Barbara
coords_to_fips(x = -119.8696, y = 34.4184)
Get the state abbreviation for a FIPS code
Description
Get the state abbreviation for a FIPS code
Usage
fips_abbr(fip)
Arguments
| fip | 2-digit or 5-digit FIPS code | 
Value
a character vector
Examples
fipio::fips_abbr("37")
fipio::fips_abbr("06001")
Get the county name for a FIPS code
Description
Get the county name for a FIPS code
Usage
fips_county(fip)
Arguments
| fip | 2-digit or 5-digit FIPS code | 
Value
a character vector
Examples
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
Description
Get the geometry for a FIPS code
Usage
fips_geometry(fip)
Arguments
| fip | 2-digit or 5-digit FIPS code | 
Value
an sfg/sfc object
Examples
## Not run: 
fipio::fips_geometry("37")
fipio::fips_geometry("06001")
## End(Not run)
Get the metadata for a FIPS code
Description
Get the metadata for a FIPS code
Usage
fips_metadata(fip, geometry = FALSE)
Arguments
| fip | 2-digit or 5-digit FIPS code | 
| geometry | If  | 
Value
a data.frame
Examples
fipio::fips_metadata("37")
fipio::fips_metadata("06001")
Get the state name for a FIPS code
Description
Get the state name for a FIPS code
Usage
fips_state(fip)
Arguments
| fip | 2-digit or 5-digit FIPS code | 
Value
a character vector
Examples
fipio::fips_state("37")
fipio::fips_state("06001")
Get the matching function that fipio is using
Description
This function is primarily for debugging purposes, or for ensuring that the correct matching function is used.
Usage
using_fastmatch()
Value
TRUE if fastmatch::fmatch is used.