Skip to content
H3 bindings for R
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
inst/h3
man
.Rbuildignore
.Rhistory
.gitignore
.travis.yml
DESCRIPTION
LICENSE
LICENSE.md
NAMESPACE
README.Rmd
README.md

README.md

Travis build status Lifecycle: experimental

h3inr

Brings Uber h3 to R via V8.

Installation

You can install the package from Github:

# install.packages("remotes")
remotes::install_github("JohnCoene/h3inr")

Example

library(h3inr)

hexagons <- quakes %>% 
  geo_to_h3(lat, long, resolution = 4L) %>% # get hex id
  h3_to_geo(hex = hex) # get hex center coordinates

hexagons %>% 
  head() %>% 
  knitr::kable()
lat long depth mag stations hex hex_center_lat hex_center_lon
-20.42 181.62 562 4.8 41 849b701ffffffff -20.44006 -178.3266
-20.62 181.03 650 4.2 15 849b757ffffffff -20.63448 -179.1528
-26.00 184.10 42 5.4 43 84bad65ffffffff -25.80558 -175.8370
-17.97 181.66 626 4.1 19 849b557ffffffff -17.88495 -178.1865
-20.42 181.96 649 4.0 11 849b705ffffffff -20.34078 -177.9118
-19.68 184.31 195 4.0 12 849b08bffffffff -19.82371 -175.8216

See globe4r for an example of what h3inr enables.

You can’t perform that action at this time.