Issue installing "udunits2" in R 3.6.1 - r

'udunits' is a dependency I need to install but when I try to install via install.packages("udunits2") I get the error:
-----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.
I followed the solutions provided in Install udunits2 package for R3.3, but I still get the same issues.
I installed libudunits2-dev using sudo apt install libudunits2-dev and the package is installed as when I call dpkg -L libudunits2-dev I get:
/.
/usr
/usr/include
/usr/include/converter.h
/usr/include/udunits.h
/usr/include/udunits2.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libudunits2.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/udunits.pc
/usr/share
/usr/share/doc
/usr/share/doc/libudunits2-dev
/usr/share/doc/libudunits2-dev/ANNOUNCEMENT
/usr/share/doc/libudunits2-dev/BACKLOG
/usr/share/doc/libudunits2-dev/copyright
/usr/share/doc/libudunits2-dev/udunits2lib.html
/usr/share/doc/libudunits2-dev/udunits2lib.pdf.gz
/usr/share/info
/usr/share/info/udunits2lib.info.gz
/usr/lib/x86_64-linux-gnu/libudunits2.so
/usr/share/doc/libudunits2-dev/changelog.Debian.gz
Even when I install udunits2 via install.packages("udunits2", configure.args = '--with-udunits2-include=/usr/include/udunits2'), the same issue occurs.
Installing on Ubuntu 20.04.1
R 3.6.1 in anaconda environment.
Any help would be greatly appreciated.

Related

Installing R `sf` and `RPostgres` packages on Unbuntu 18.04.4

Desire is to installed R {sf} and {RPostgres} packages on Ubuntu 18.04.4.
Trying:
R$> install.packages("sf")
configure: error: gdal-config not found or not executable.
Some SO searching (eg https://stackoverflow.com/a/49181048/2802810) suggests this:
sh$> sudo apt-get install libgdal-dev
The following packagess have unmet dependencies: libpq-dev :
Depends: libpq5 (= 10.12-0Ubuntu0.18.04.1) but 12.3-1.pgdg18.04+1 is
to be installed E: Unable to correct problems, you have broken
packages.
I also need libpq-dev for R {RPostgres}.
You may want to add PPA, depending on your R version.
https://launchpad.net/~marutter/+archive/ubuntu/c2d4u
https://launchpad.net/~marutter/+archive/ubuntu/c2d4u3.5
https://launchpad.net/~c2d4u.team/+archive/ubuntu/c2d4u4.0+
After adding PPA, you can install using sudo apt install r-cran-sf and sudo apt install r-cran-rpostgres
OKaaaay. The box I'm working in didn't have a Postgres repo installed (https://www.postgresql.org/download/linux/ubuntu/). Never libpq libs and that was all it needed.

Not able to install packages MicrosoftML and mrsdeploy in R studio

I am trying to deploy R code onto server. But for I think we need to install both MicrosoftML and mrsdeploy. But I get an error while trying to download:
install.packages("MicrosoftML")
Installing package into ‘C:/Users/vinay/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘MicrosoftML’ is not available (for R version 3.5.2)
install.packages("mrsdeploy")
Installing package into ‘C:/Users/vinay/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘mrsdeploy’ is not available (for R version 3.5.2)
As the above error suggest you that the packages MicrosoftML and mrsdeploy are not available in R version 3.5.2, so you will have to use the R version in which these packages are present/compatible.
You can refer to this issue:
https://github.com/MicrosoftDocs/feedback/issues/352
For MicrosoftML refer to this:
https://learn.microsoft.com/en-gb/machine-learning-server/r/concept-what-is-the-microsoftml-package
You need to make an R Client deployment to have the ability to use the RevoScaleR, MicrosoftML, and mrsdeploy packages. Specifically for R version 3.5.2 and Ubuntu 14.04 - 16.04, please follow the following steps:
# Install as root or sudo
sudo su
# If your system does not have the https apt transport option, add it now
apt-get install apt-transport-https
# Set the package repository location containing the R Client distribution.
# On Ubuntu 14.04.
# wget http://packages.microsoft.com/config/ubuntu/14.04/prod/packages-microsoft-prod.deb
# On Ubuntu 16.04.
wget http://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
# Register the repo.
dpkg -i packages-microsoft-prod.deb
# Check for microsoft-prod.list configuration file to verify registration.
ls -la /etc/apt/sources.list.d/
# Update packages on your system
apt-get update
# Install the 3.5.2 packages
# Alternative for 3.4.1: apt-get install microsoft-r-client-packages-3.4.1
# Alternative for 3.4.3: apt-get install microsoft-r-client-packages-3.4.3
apt-get install microsoft-r-client-packages-3.5.2
# List the packages
ls /opt/microsoft/rclient/
Then download one of:
Ubuntu 14.04:
wget https://packages.microsoft.com/ubuntu/14.04/prod/pool/main/m/microsoft-r-client-packages-3.5.2/microsoft-r-client-packages-3.5.2.deb
Ubuntu 16.04:
wget https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/microsoft-r-client-packages-3.5.2/microsoft-r-client-packages-3.5.2.deb
Install the packages with:
dpkg -i *.deb
If you use RStudio you can on Linux add R_LIBS_SITE=/opt/microsoft/rclient/3.5.2/libraries/RServer on bottom of the file /opt/microsoft/rclient/3.5.2/runtime/R/etc/Renviron
Both packages mrsdeploy and MicrosoftML will be now available from RStudio as you can check with:
library(mrsdeploy)
library(MicrosoftML)
For instructions like the above for newer R versions please check this Microsoft Docs page.

unable to install rvest package

I need to install rvest package for R version 3.1.2 (2014-10-31)
I get these errors:
checking whether the C++ compiler supports the long long type... no
*** stringi cannot be built. Upgrade your C++ compiler's settings
ERROR: configuration failed for package ‘stringi’
* removing ‘/usr/local/lib64/R/library/stringi’
ERROR: dependency ‘stringi’ is not available for package ‘stringr’
* removing ‘/usr/local/lib64/R/library/stringr’
ERROR: dependency ‘stringr’ is not available for package ‘httr’
* removing ‘/usr/local/lib64/R/library/httr’
ERROR: dependency ‘stringr’ is not available for package ‘selectr’
* removing ‘/usr/local/lib64/R/library/selectr’
ERROR: dependencies ‘httr’, ‘selectr’ are not available for package ‘rvest’
* removing ‘/usr/local/lib64/R/library/rvest’
Any ideas on how I could install R package rvest?
My system is Ubuntu 14.04 with R:3.2.3, and I had the same problem.
Then I checked err meg and tried to install library of libcurl4-openssl-dev and libxml2-dev:
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
After installed, install.packages("rvest") was successful.
I needed dependencies such as Rcurl, XML, rvest, xml2, when I was trying to install tidyverse, DESeq2, RUVSeq in Rstudio Version 1.1.456 on a fresh installed Ubuntu 18.04. Anyway, there were a bunch of missing dependencies. This answer might fit better as a comment for Ubuntu 18.04, but I don't have that many reputation. So just trying to make a summary of solutions works for Ubuntu 18.04 here.
In the terminal, run:
sudo apt-get install libcurl4-openssl-dev libssl-dev
sudo apt-get install libxml2-dev
Then within Rstudio,
install.packages("xml2")
install.packages("rvest")
install.packages("tidyverse") # might need other dependencies installed in Rstudio
Got tidyverse!
In the terminal:
sudo apt-get install libmysqlclient-dev ## for RMySQL
Then within the Rstudio
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
biocLite('RUVSeq') ## might have messages as following
installation path not writeable, unable to update packages: cluster, foreign, MASS, Matrix, mgcv, nlme, survival
In the terminal:
sudo R ## give R the root permission
## in the R session within the terminal
pks <- c('cluster', 'foreign', 'MASS', 'Matrix', 'mgcv', 'nlme', 'survival')
install.packages(pks)
q()
That's my own experience. Hope this one has a good Generalizability.
I was able to build the stringi package as this:
install.packages('stringi', configure.args='--disable-cxx11')
My answer is definitely late to this question. Nevertheless, somebody may find it useful.
I run into the same problem so I run this command on the shell:
sudo apt-get upgrade pkg-config
It worked for me.

‘seewave' install error “'sndfile.h' file not found” (for R 3.2.0 under OSX Yosemite)

When updating to R 3.2.0 I had to reinstall seewave.
I managed to install the required packages fftw, tuneR, rgl, and rpanel.
But, when trying to compile seewave I got the message:
stft.c:3:11: fatal error: 'sndfile.h' file not found
On linux it is sufficient to install libsndfile library, for example with
sudo apt-get install libsndfile1-dev
On OS X just do:
brew install libsndfile
Pisca46 - Installing via 'brew install libsndfile' helped.
On CentOS, the package has a different name :
sudo yum install libsndfile-devel
I also had to install the fftw-devel yum package

how to install R packages "RNetCDF" and "ncdf" on Ubuntu?

I would like to use the R packages RNetCDF and ncdf in Ubuntu.
When I try install.packages('RNetCDF') or install.packages('ncdf'), I get similar errors:
...
ncdf.c:3:20: fatal error: netcdf.h: No such file or directory
compilation terminated.
make: *** [ncdf.o] Error 1
ERROR: compilation failed for package ‘ncdf’
...
Warning message:
In install.packages("ncdf") :
installation of package ‘ncdf’ had non-zero exit status
The packages libnetcdf6 and netcdf-bin from the Ubuntu repository are installed. Do I need to do something else?
You need to install the -dev of those packages to get the headers that are required to compile the package. In this case, you need libnetcdf-dev, udunits-bin and libudunits2-dev
In my case, libudunits2-dev package was needed.
sudo apt-get install libudunits2-dev
Since I installed NetCDF from source, I had to manually specify the locations of lib and include folders
install.packages("/home/user/Downloads/RNetCDF_1.6.1-2.tar.gz",
repos = NULL,
type="source",
dependencies=FALSE,
configure.args="--with-netcdf-include=/usr/local/netcdf-4.2.1-build/include --with-netcdf-lib=/usr/local/netcdf-4.2.1-build/lib")
Just to clarify, since your initial issue is in R, and the fix is applied outside of R. I initially was trying to do
install.packages("libnetcdf-dev"), which didn't work.
instead, from outside of R: sudo apt-get install libnetcdf-dev
That fixed it for me.
In Ubuntu 20.04 LTS one can install the ncdf4 package (which supersedes ncdf), including all dependencies, with the bash command sudo apt install r-cran-ncdf4. Similarly for RNetCDF you can use sudo apt install r-cran-rnetcdf.

Resources