Error message installing Cairo package in R - 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

Related

not able to install 'fable' package (ERROR: compilation failed for package ‘fable’)

I am trying to install fable running the command install.packages("fable"), as it says in https://cran.r-project.org/web/packages/fable/readme/README.html
however i am getting the following:
It says clearly that it is because i don't have llapack, lblas and lgfortran in my computer. But i am not sure how to procede here. I'm using Ubuntu 20.04.3 LTS
I'll appreciate any guidence.
To install from sources, you will need a GNU Fortran compiler installed. On Ubuntu this can be done with sudo apt install gfortran.
Alternatively, you can install a precompiled binary from the RStudio Package Manager - some guidance on how this can be done can be found here: https://packagemanager.rstudio.com/client/#/repos/1/overview

Unable to install dependencies for package kableExtra

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

How to install libxml2 package in R if it's not available for my version?

I wanted to install "DESeq2" package in R, but it was missing the xml2-config file. I found somewhere that it can be obtained by installing the libxml2 package, but when I tried it gives error that it's not available for R version 3.4.2. Anyone has idea what to do?
You can install the dev version: devtools::install_github("r-lib/xml2")
After running what #amarchin wrote it didn't work instantly but R suggested to install libxml2-dev. So I run: sudo apt-get install libxml2-dev in Terminal.
And then in R console I typed the code from #amarchin: devtools::install_github("r-lib/xml2")
And it worked :)

inconsolata missing to build R vignette

On ubuntu 14.04 with texlive, checking an R package, for example with devtools check() would return :
LaTeX errors found:
! LaTeX Error: File `inconsolata.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
! Emergency stop.
<read *>
l.276 ^^M
! ==> Fatal error occurred, no output PDF file produced!
Installing texlive-fonts-extra should take care of it.
You can also (though probably not recommented) tell Rd not to use inconsolata. Just change:
\DeclareOption{inconsolata}{\setboolean{Rd#use#inconsolata}{true}}
to
\DeclareOption{inconsolata}{\setboolean{Rd#use#inconsolata}{false}}
in your Rd.sty file. On my installation it is at :
/usr/share/R/share/texmf/tex/latex/Rd.sty
but a
locate Rd.sty
should find it on any system.
I'm on macOS using Homebrew and this worked for me:
# LaTeX tools like pdflatex
brew cask install basictex
# Install texlive packages needed to build R package vignettes
sudo tlmgr update --self
sudo tlmgr update --all
sudo tlmgr install titling framed inconsolata
sudo tlmgr install collection-fontsrecommended
If you are using the Travis Continuous Integration
service, your problem could be related to the CTAN
mirrors having yet to update.
The issue appears in the Travis R community forum:
might be related to the recent switch to TexLive-2019 as the LaTeX package manager seems to fail finding inconsolata in the repository.
...
It looks to me like the mirror chosen was has not updated to 2019, so I think this will resolve itself naturally when the mirrors catch up. If not I can look into it.
In the meantime, I solved it by forcing a previous version of TeXLive with a downgrade to OSX 10.12 in .travis.yml:
# macOS 10.12 version
osx_image: xcode9.2
See this Travis page for the correspondence between XCode and OSX versions and the original thread in DevOps StackExchange.
In Debian, instead of installing the huge texlive-fonts-extra package, run this at your shell:
tlmgr install inconsolata
updmap-user
I have Mac OSx and the accepted solution didn't work to me.
This was the solution in my case, to install mactex: https://tug.org/mactex/mactex-download.html
tlmgr gave me a warning about a checksum. However this worked
get inconsolata.tds.zip from https://ctan.org/pkg/inconsolata
cd /usr/share/texmf/
sudo unzip inconsolata.tds.zip
sudo mktexlsr
I have had this problem every time I upgrade R. I agree the 1.7GB texlive-fonts-extra is ridiculous for a small file, although I understand that it does give you a choice of several Klingon fonts
this is for texLive on Ubuntu

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