Skip to content

Commit

Permalink
Merge pull request #12 from crazycapivara/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
crazycapivara authored Feb 17, 2019
2 parents 42dcb51 + 2a5c595 commit 3ac025c
Show file tree
Hide file tree
Showing 77 changed files with 33,005 additions and 54 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
inst/doc
.Rhistory
.RData
.Rproj.user
11 changes: 8 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: h3
Title: R bindings for H3
Version: 0.1.1
Date: 2019-02-01
Version: 3.3.0
Date: 2019-02-17
Authors@R: person("Stefan","Kuethe", role = c("aut", "cre"), email = "[email protected]")
Maintainer: Stefan Kuethe <[email protected]>
Description: Provides R bindings for H3 <https://uber.github.io/h3/>,
Expand All @@ -21,5 +21,10 @@ Imports:
tibble
Suggests:
sf,
testthat
testthat,
knitr,
rmarkdown,
leaflet,
dplyr
RoxygenNote: 6.1.0
VignetteBuilder: knitr
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# h3 3.3.0

* Added `pkgdown` site.
* Added `Get started` vignette.

# h3 0.1.1

* Added a `NEWS.md` file to track changes to the package.
8 changes: 4 additions & 4 deletions R/h3_hierachy.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#' Get the parent of the given hexagon at a particular resolution.
#' @inheritParams h3_to_geo
#' @param h3_index character scalar representing a valid H3 index
#' @param res resolution of parent
#' @return character
#' @return character scalar
#' @export
h3_to_parent <- function(h3_index, res) {
rcpp_h3_to_parent(h3_index, res)
}

#' Get the children of the given hexagon at a particular resolution.
#' @inheritParams h3_to_geo
#' @inheritParams h3_to_parent
#' @param res resolution of children
#' @return character
#' @return character vector
#' @export
h3_to_children <- function(h3_index, res) {
rcpp_h3_to_children(h3_index, res)
Expand Down
10 changes: 9 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ Then you can run:
git clone https://github.com/crazycapivara/h3-r.git
pushd h3-r
chmod +x install-h3c.sh
# Install H3 C Library
./install-h3c.sh
# R -q -e 'devtools::install()'
# Install H3 for R
R -q -e 'devtools::install()'
popd
rm -rf h3-r
```
Expand Down Expand Up @@ -95,3 +97,9 @@ h3_to_geo_boundary_sf(neighbors) %>%
h3_set_to_multi_polygon(neighbors) %>%
sf::st_geometry() %>% plot(col = "green")
```

## Run tests

```{r tests}
devtools::test()
```
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ Then you can run:
git clone https://github.com/crazycapivara/h3-r.git
pushd h3-r
chmod +x install-h3c.sh
# Install H3 C Library
./install-h3c.sh
# R -q -e 'devtools::install()'
# Install H3 for R
R -q -e 'devtools::install()'
popd
rm -rf h3-r
```
Expand Down Expand Up @@ -79,7 +81,7 @@ h3_to_geo_sf(h3_index)
# Get the vertices of the hexagon
h3_to_geo_boundary(h3_index)
#> [[1]]
#> [,1] [,2]
#> lat lng
#> [1,] 37.34110 -122.0416
#> [2,] 37.35290 -122.0340
#> [3,] 37.36352 -122.0428
Expand Down Expand Up @@ -121,3 +123,18 @@ h3_set_to_multi_polygon(neighbors) %>%
```

<img src="man/figures/README-h3-algorithms-2.png" width="400px" />

Run tests
---------

``` r
devtools::test()
#> Loading h3
#> Testing h3
#> H3 hierachy: ....
#> H3 indexing: .....
#> H3 misc: ..
#> H3 traversal: .....
#>
#> DONE ======================================================================
```
5 changes: 4 additions & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

284 changes: 284 additions & 0 deletions docs/articles/h3.html

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/articles/h3_files/Proj4Leaflet-0.7.2/proj4-compressed.js

Large diffs are not rendered by default.

Loading

0 comments on commit 3ac025c

Please sign in to comment.