Skip to content

geomarker-io/tract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get Census Tract ID for Exact Locations

R-CMD-check CRAN status

Installation

You can install the development version of tract from GitHub with:

# install.packages("devtools")
devtools::install_github("geomarker-io/tract")

Example

In R, get census tract identifiers for exact locations and years using the get_census_tract_id() function:

library(tract)

get_census_tract_id(
  s2::as_s2_cell(c("8841b399ced97c47", "8841b38578834123")), 
  year = "2020")
#> ℹ Found 2 unique locations in 1 state
#> 8841b399ced97c47 8841b38578834123 
#>    "39061003200"    "39061003000"

S2 geohash

The s2 geohash is a hierarchical geospatial index that uses spherical geometry. In R, s2 cells can be created using their character string representation, or by specifying latitude and longitude coordinates; e.g.:

s2::s2_lnglat(c(-84.4126, -84.5036), c(39.1582, 39.2875)) |> s2::as_s2_cell()
#> <s2_cell[2]>
#> [1] 8841ad122d9774a7 88404ebdac3ea7d1

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages