Unable to install dependencies for package kableExtra - r

I recently upgraded Ubuntu 16.04 to 18.04 and started having problems concerning rvest and xml2 in my R installation.
I'm trying to install package kableExtra but i keep getting errors even though I have dependencies installed. install.packages("kableExtra") spits this:
Searching SO it came to my knowledge that I need dependencies libxml2-dev for xml2. What happens is that I already have it installed.
Some other important packages like tidyverse complains about those same dependencies. I usually solve things like this searching here and google, but this time it is not working. I need some serious help here.
I'll appreciate any tip.

I ran into this page with issues installing kableExtra on Ubuntu 20.04. This post helped.
sudo apt install libfontconfig1-dev

Related

Unable to install the tidyverse

There is no package called 'tidyverse' is the error message I get after doing this:
install.packages('tidyverse', dependencies = T);
install.packages('DBI', dependencies = T);
library(DBI);
library(tidyverse);
I use Ubuntu 18.04 and Rstudio.
Could anyone sort me out here, please?
You may find this blog post and associated video useful -- it shows how to install all of tidyverse on Ubuntu directly from prebuilt binaries with one command.
In short, that is what PPAs are good for. The associate slides have the relevant commands.
And once you do the required step of adding the two PPAs and running sudo apt-get update (again, both detailed in the slides) then all it takes is a single sudo apt-get install r-cran-tidyverse as the video shows.
Added bonus: because you install binaries that pre-made it is the fastest possible installation.
Edit three years later: We now have r2u which thanks to its use of bspm plus its complete set of CRAN binaries lets you just use install.packages("tidyverse") to install all packages as binaries along with all dependencies in a matter of seconds as shown in a few gifs on the site, my blog, and elsewhere. Plus anybody can try it in the browser via gitpod from the r2u site.
The default setup in R on Linux is to compile packages from source since CRAN only provides binaries for macOS and Windows. This is not the recommended way to install packages on Ubuntu. As pointed out by #DirkEddelbuettel in his edit to his answer, you can use r2u and bspm to obtain binaries for all CRAN packages. This will require initial setup but result in a much better user experience. If you insist on compiling the tidyverse yourself, my old answer remains below.
Old answer
tidyverse has external dependencies that cannot be installed through R and that aren't preinstalled in Ubuntu. Install the following packages via the terminal:
sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev
Run install.packages("tidyverse") again after that.
You can find more help regarding this here.

Cannot install Ckmeans package on Ubuntu 18.04

I am not able to install Rcpp and many other packages (e.g. devtools) as a requirement for the opm-package.
Ubuntu 18.04, R Version: 3.5.1, gcc version 7.3.0
Can anybody give suggestions to fix this issue?
EDIT: I managed now to install rcpp via apt-get; I used the below suggested repos and R 3.5.1. Now I am stuck with installing Ckmeans (Package maintainer contacted).
EDIT_2: The author sent me a new version of Ckmeans, but the problem persists. To sum up: unable to install ckmeans; Ubuntu 18.04, R 3.5.1, repos c2d4u3.5, cran repos.
update: I removed the R-bionic ppa and reinstalled R (3.5.0) with r-base-dev. I managed to tackle down nearly all the dependencies for opm, if not within R, so at least with the ubuntu-r-cran-packages (from the abovely mentioned repos); only one dependency is missing (OPM-Script): Ckmeans. I tried to install from source with 5 different versions, but so far without success.
After today's System-update I was able to install Ckmeans.1d.dp_4.2.2 and opm_1.3.72 without any problem.

"rgdal" installation failed on ubuntu

I use travis to check my R package, it's based on a virtual machine of ubuntu. One of my dependencies is rgdal from CRAN, which cannot be installed correctly on travis.
First it said:
ERROR: dependencies ‘rgdal’ is not available for package ‘my package’
I followed the instruction here, then comes the endless dependencies, I installed one by one, according to the instruction of every trial. Finally I installed packages is as below:
libproj-dev
libcurl4-gnutls-dev
libdap-dev
libgdal-dev
libgdal1h
libhdf5-dev
libhdf5-serial-dev
libgdal-dev
libgdal1-dev
It said I still need to install libhdf5-7 = 1.8.11-3ubuntu1~precise1~ppa1
But when I install package libhdf5-7 = 1.8.11-3ubuntu1~precise1~ppa1, it gives another error:
E: Unable to locate package
E: Unable to locate package 1.8.11-3ubuntu1~precise1~ppa1
E: Couldn't find any package by regex '1.8.11-3ubuntu1~precise1~ppa1'
And it seems no more solutions now.
I wonder how to fix this on travis? Is it a common issue on only travis virtual machine or it could happen on any ubuntu machine? Or the package rgdal has some problems with ubuntu?`
Background:
All my installation above used apt-packages of travis, which is explained as below by travis:
apt_packages: A list of packages to install via apt-get. Common examples here include entries in SystemRequirements. This option is ignored on non-linux builds
As of this week, you can opt into using Ubuntu 14.04 on Travis:
See this blog post from Travis for details
See this .travis.yml where I enable Trusty aka 14.04
Switching to 14.04 may be enough in this case. If not, also note that you can prepare your own .deb packages. I mention this in an blog post from this summer.
As the geospatial packages are a little involved that is probably your best. You would need to know how to build Debian packages, and how to use Launchpad to have them auto-built for you. Both topics have lots of tutorials.

Error message installing Cairo package in R

I want to install the Cairo package in R using:
install.packages("Cairo")
Unfortunately this doesn't work. The error message is following:
xlib-backend.c:34:74: fatal error: X11/Intrinsic.h: No such file or directory
compilation terminated.
make: *** [xlib-backend.o] Error 1
ERROR: compilation failed for package ‘Cairo’
* removing ‘/home/magnus/R/x86_64-pc-linux-gnu-library/3.1/Cairo’
Does anybody have an answer for this problem? I couldn't find any help in the internet so far.
Many thanks in advance!
Yours,
broesel
For me (Ubuntu 15.04) installing libxt-dev solved the problem.
(I know it's mentioned in comments above, but thought it might be good to have it in answers as well)
You need the development header as the file Intrinsic.h is not found.
For the related package cairoDevice (which I maintain for Debian), I ensure the following is installed:
libgtk2.0-dev, libcairo2-dev, xvfb, xauth, xfonts-base
If you are on a different distribution these might be called something else. The key is that the Gtk and Cairo header packages also pull in other, needed, x11 packages.
libXt-devel needs to be installed in Fedora (25):
sudo dnf install libXt-devel
On a Mac, my problems were solved once I installed libxt
brew install libxt
Similar, I'm sure to https://stackoverflow.com/a/41455437/61728
Along with the packages libgtk2.0-dev, libcairo2-dev, xvfb, xfonts-base and xauth that Dirk mentioned in the above comment , I also installed libxt-dev (after Magnus' comment) after which I was able to install Cairo in R. I am using Ubuntu 16.04 LTS
I had a lot of trouble with this, for some reason this didn't work
apt-get install libx11-dev libxt-dev libgtk2.0-dev libcairo2-dev xvfb xauth xfonts-base -y
but when I ran this immediately afterwards (even though it was already installed above), then the Cairo R package installed successfully. Not exactly sure why but thought I'd put it here in case it helps someone.
apt-get install libcairo2-dev -y
I used this:
devtools::install_github("jcassiojr/BayesPeak")
then:
library("BayesPeak")
And worked.
Paulo

R BayesVarSel on Ubuntu installation

I'm trying to install the BayesVarSel package on a ubuntu 12 box on AWS EC2. It works fine on my windows 7 machine (R 2.15.1).
I've attached a screenshot of the error message. It appears to be an issue with the GNU GSL library. I couldn't find a quick way to install GSL (ie sudo apt-get GSL, etc.) so I wanted to see if others have had a similar issue. I'm open to other packages with similar functionality.
EDIT:
A couple other things I've tried without luck :
I was able to recreate the error with Ubuntu 12.04.1 LTS (desktop) running in VirtualBox.
As #Dirk Eddelbuettel suggested, sudo apt-cache search libgsl produced a useful list of packages. It's not clear why that didn't work on your machine.
I installed libgsl with:
sudo apt-get install libgsl0ldbl
sudo apt-get install libgsl0-dev
Now BayesVarSel compiles and loads without error.
Do
apt-cache search libgsl
and everything should be a little clearer. Those packages have existed longer than either Ubuntu or Amazon EC2 so it really should not take superhuman effort to find them.
And if apt-cache search libgsl is too difficult, try packages.ubuntu.com
where you can search for the package containing the file in your error message (eg /usr/include/gsl/gsl_vector.h) and "Yes, Veronica" you can search for substrings too.
On Fedora the required package can be installed with dnf install gsl-devel.

Resources