Reputation: 808
My understanding is that the "H3 geospatial indexing system" is a kind of "coordinate system" developed by Uber, whose main feature is that it is based on a system of hierarchical hexagons. "he" is a library in R which could help one to work with data in this "H3 spatial reference system", but is not stored in CRAN but a GitHub (https://github.com/crazycapivara/h3-r).
However, I haven't been able to install this library in R. I have trayed this (as the instruction in the GitHub suggested):
install.packages("devtools")
devtools::install_github("crazycapivara/h3-r")
but it did not work, and is returning this message:
devtools::install_github("crazycapivara/h3-r")
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘digest’
Then, I trayed the same steps but in "R-cloud" and get a different error:
h3_hex-ring.cpp:2:22: fatal error: h3/h3api.h: No such file or directory
compilation terminated.
/opt/R/4.0.3/lib/R/etc/Makeconf:181: recipe for target 'h3_hex-ring.o' failed
make: *** [h3_hex-ring.o] Error 1
ERROR: compilation failed for package ‘h3’
* removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0/h3’
Error: Failed to install 'h3' from GitHub:
(converted from warning) installation of package ‘/tmp/RtmpzwLngc/file1698ded56/h3_3.3.2.tar.gz’ had non-zero exit status
I reviewed that GitHub, and I wasn't able to figure out what's wrong. Does anyone has successfully installed this library on R or knows a different library to work whit this kind of spatial reference system?
Upvotes: 0
Views: 1467
Reputation: 1
The error arises if you have not installed "rtools" in your computer. It seems it can not perform the 'make' command. Make sure you add 'C:\rtools43\usr\bin' to your PATH variable in your system/user environment.
Upvotes: 0
Reputation: 1214
Your immediate problem is that you appear to need to install the dependency package 'digest' (and possibly others) before installing h3-r. Try doing that first (and I assume you were able to build the underlying C package as well).
I'm not sure how actively maintained h3-r
is, so it may not play well with recent releases of R. If you want to try using H3 in R via the js transpile, try https://github.com/obrl-soil/h3jsr (disclaimer: I'm the author). It will likely struggle with very large datasets but should be ok for most smaller applications.
Upvotes: 1