Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to install rvest package

Tags:

r

rvest

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?

like image 962
user1471980 Avatar asked Jun 23 '15 16:06

user1471980


Video Answer


2 Answers

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.

like image 84
NoahC Avatar answered Nov 16 '22 03:11

NoahC


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.

like image 43
Guannan Shen Avatar answered Nov 16 '22 02:11

Guannan Shen