0

I'm trying to install tmap package on R and it requires lwgeom

But when it comes to install 'lwgeom' I get this error:

configure: error: proj_api.h not found in standard or given locations. ERROR: configuration failed for package ‘lwgeom’

I've tryed to install libproj-dev but I've already got it.

I've also installed rgdal package sucessfully but I still got this error

I run on R-studio on Linux Mint 19

how to fix it and install tmap?

A Neto
  • 233
  • 2
  • 10

2 Answers2

1

Consider installing the lwgeom package directly, by using

install.packages("lwgeom", configure.args=c("--with-proj-include=/usr/local, --with-proj-lib=/usr/local"))

in your R console; of course using a proper path to your PROJ location (mine happens to live in /usr/local, but you will want to double check).

Jindra Lacko
  • 7,814
  • 3
  • 22
  • 44
  • I searched `locate proj_api.h` and received "/usr/include/proj_api.h" than : `install.packages("lwgeom", configure.args=c("--with-proj-include=/usr/include, --with-proj-lib=/usr/include"))` still: "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." – A Neto Apr 16 '20 at 12:14
1

Consider installing source from github https://github.com/r-spatial/lwgeom

Or wait for a new upcoming 0.2-4 version of lwgeom. That error was fixed 2 days ago. You may also install older version 0.2-2 which is correct.