I am trying to install "choroplethr."
I have read the following related-looking errors:
- https://askubuntu.com/questions/1057100/error-libudunits2-a-not-found-when-installing-ggraph-additional-error-objec
- Install udunits2 package for R3.3
Their recommendation is to install something I have already installed. I have libudunits2 installed in a standard location, with:
$ sudo apt-get install libudunits2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libudunits2-dev is already the newest version (2.2.26-1).
I can see headers:
$ ll /usr/include/ | grep unit
-rw-r--r-- 1 root root 39998 Jan 5 2018 udunits2.h
-rw-r--r-- 1 root root 5195 Jan 5 2018 udunits.h
However, on installation, I get this error:
$ R
R version 3.5.1 (2018-07-02) -- "Feather Spray"
> install.package("choroplethr", dep=T)
...
configure: error: in `/tmp/RtmpWC06JV/R.INSTALL7cbb4928db67/units':
configure: error:
--------------------------------------------------------------------------------
Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: udunits2-devel (Fedora, EPEL, ...)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
if the library was not found, and/or:
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------
I've done these settings, but
install.packages("udunits2", configure.args = '--with-udunits2-include=/usr/include/udunits2')
-----Error: libudunits2.a not found-----
If the udunits2 library is installed in a non-standard location,
use --configure-args='--with-udunits2-lib=/usr/local/lib' for example,
or --configure-args='--with-udunits2-include=/usr/include/udunits2'
replacing paths with appropriate values for your installation.
You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIB
environment variables.
If udunits2 is not installed, please install it.
It is required for this package.
What am I missing? Is this package OSX only?
For Ubuntu with R 3.5 you can use the c2d4u3.5 PPA made available by the same persons that bring you R Ubuntu packages on CRAN, c.f. https://cran.r-project.org/bin/linux/ubuntu/README.html and http://dirk.eddelbuettel.com/blog/2017/12/22/:
After that you can install binary packages for most CRAN packages:
This should work for all packages that are mentioned in CRAN task views.
Besides this, I tried to reproduce your installation problems using docker:
However, the image was build without problems.