2

I'm trying to instal the rstan in Ubuntu 18.04. I started with

 apt-get install r-cran-rstan

and it showed dependence on the packages : r-cran-ggplot2 , r-cran-pkgbuild and r-cran-v8. Then while trying to install all of them, another dependence on r-api-3.5, which I tried to install with

  apt-get install r-api-3.5

Then I saw the following message :

The r-api-3.5 package is a virtual package provided by: r-base-core 3.6.3-1bionic [Not a candidate version]

E: The 'r-api-3.5' package has no candidate for installation

I read some tutorials like this one: Not able to install rstanarm on Ubuntu 18.04 LTS saying I should add the ppa by doing :

sudo add-apt-repository -y "ppa:marutter/rrutter"
sudo add-apt-repository -y "ppa:marutter/c2d4u3.5"
sudo apt update
sudo apt install r-cran-rstanarm

and I did. But it's still not working. My R version is the latest one. I didn't find documentation about r-api-3.5 in Ubuntu. If anyone knows how to solve it, please tell me.

mariellaB
  • 21
  • 2
  • While questions asking how to install *programming tools* are on-topic, I think it's better to ask on Ubuntu question sites. – user202729 Sep 30 '20 at 01:56

1 Answers1

-1

I ran into the same issue and my colleague as well. We just jumped directly to the install and it worked fine. In short:

remove.packages("rstan")
if (file.exists(".RData"))
file.remove(".RData")
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
library(rstan)
example(stan_model,run.dontrun = TRUE)

Source and more detailed explanation: https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#installation-of-rstan

Lours
  • 75
  • 8
  • Thank you Lours! I was only able to solve this problem after installing the version 3.5 of R. Now it works. – mariellaB Nov 18 '20 at 15:20