Can´t install package 'lwgeom"

I am a new user on RStudio Cloud and I can't install the "lwgeom" package when I try to install it from the console this happens:

> install.packages("lwgeom")
Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'http://package-proxy/src/contrib/lwgeom_0.2-3.tar.gz'
Content type 'application/x-gzip' length 502493 bytes (490 KB)
downloaded 490 KB

* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: gcc
configure: CXX: g++ -std=gnu++11
configure: pkg-config proj exists, will use it
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘lwgeom’
* removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.6/lwgeom’
Warning in install.packages :
  installation of package ‘lwgeom’ had non-zero exit status

The downloaded source packages are in
> library(lwgeom)
Error in library(lwgeom) : there is no package called ‘lwgeom’

It seems like a system dependency is missing, unfortunately, there is nothing you can do from the user side, this has to be fixed by RStudio people.

EDIT: It seems there is a walk-around solution for this, you have to install from GitHub.

Thank you for the recommendations, however after installing lwgeom from github this error appears

Error: "lwgeom_make_valid" is not an exported object from "namespace:lwgeom"

I don't know if this is a function that is not available for the GitHub version I installed

The github version is the latest version of the package (even newer than the CRAN version) so I think you might want to ask the package author for clarification, you can do so by filing an issue on the github repo.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.