2

It is somehow impossible for me to install new R-packages on my Linux Mint 18 system. I need to install ggplot2 and car. After the input

install.packages("ggplot2")

R is working for a very long time and after this, I get the output

Warning in install.packages : installation of package ‘scales’ had non-zero exit status ERROR: dependencies ‘digest’, ‘plyr’, ‘reshape2’, ‘scales’, ‘tibble’, ‘lazyeval’ are not available for package ‘ggplot2’ * removing ‘/home/phine/R/x86_64-pc-linux-gnu-library/3.2/ggplot2’ Warning in install.packages : installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in ‘/tmp/RtmpsK4IjC/downloaded_packages’ Warnmeldung: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘ggplot2’

The same happens, if I am trying to install the car package.

So far I was trying to follow the help from R-bloggers (https://www.r-bloggers.com/installing-r-packages/), but I get the same output.

Further I tried: (Error installing ggplot2)

if(!require(ggplot2)) install.packages('dplyr',dependencies = TRUE)

The output is the same as above

there is no package called ‘ggplot2’

After this I read the posts on this page (Can't install R packages on Linux Mint 17). After running in the terminal,

sudo apt-get install r-base-dev 

I get the output (this is a free translation. Unfortunately my terminal is speaking german, even if I change the system language to english)

E: package »r-base-dev« has no installation candidate

Input:sudo apt-get install r-cran-rcpp

Output:E: package r-cran-rcpp not found.

I hope my question is clear and precise enough. I am beginner in using R and Linux.

Community
  • 1
  • 1
JoBu
  • 21
  • 3
  • have you done sudo apt-get update and sudo apt-get upgrade? Are these coming up with errors? I'm running Mint18 and have no problems with r installation. Do you have r-base installed? What does your /etc/apt/sources.list contain? Does http://stackoverflow.com/questions/21631191/issues-in-installing-r-base-dev relate? – marts Dec 02 '16 at 23:36
  • 1
    Have you check if you have `deb https://cran.rstudio.com/bin/linux/ubuntu trusty/` in your `/etc/apt/sources.list` file. Note: `trusty` is for Linux Mint 17.3 Rosa. After that do `sudo apt-get update` then install `r-base-dev`. See more [here](https://cloud.r-project.org/bin/linux/ubuntu/README.html) – Tung Dec 03 '16 at 00:42
  • 1
    I included `deb https://cran.rstudio.com/bin/linux/ubuntu xenial/` to my `sorces.list`, ran the uptate and tried to install the r-base-dev again, but it dident work. My output looks exactly the same like here [http://stackoverflow.com/questions/21631191/issues-in-installing-r-base-dev/41682646#41682646]. The problem is, that I really can't find this "Software Sources" window in Mint. Further I ran `sudo aptitude search r-base-dev` and there it seems, that r-base-dev already exists: `p r-base-dev - GNU R installation of auxiliary GNU R pack`. – JoBu Jan 16 '17 at 19:00

2 Answers2

2

Try installing after starting R in the vanilla mode:

$  R --vanilla

It is likely to work. If not post the errors.

rnso
  • 23,686
  • 25
  • 112
  • 234
0

I faced similar problem with Linux Mint 18.1 and tried to install ggplot2 package first time in my new installation of the R (3.2.3) and RStudio (1.0.136). Problem was solved when I installed r-base-dev via Software manager of the Mint.

Afterwards I have added cran to the /etc/apt/sources.list as thecatalyst suggest above.

vtenhunen
  • 49
  • 4