【问题标题】:how to install rstan in ubuntu 18.04如何在 ubuntu 18.04 中安装 rstan
【发布时间】:2020-09-29 14:35:57
【问题描述】:

我正在尝试在 Ubuntu 18.04 中安装 rstan。我开始了

 apt-get install r-cran-rstan

它显示了对软件包的依赖:r-cran-ggplot2、r-cran-pkgbuild 和 r-cran-v8。 然后在尝试安装所有这些时,又依赖于 r-api-3.5,我尝试使用它来安装

  apt-get install r-api-3.5

然后我看到以下消息:

r-api-3.5包是一个虚拟包,由:r-base-core提供 3.6.3-1bionic [不是候选版本]

E: 'r-api-3.5' 包没有安装候选者

我读了一些类似这样的教程:Not able to install rstanarm on Ubuntu 18.04 LTS 说我应该通过这样做来添加 ppa:

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

我做到了。但它仍然无法正常工作。我的 R 版本是最新的。我没有在 Ubuntu 中找到有关 r-api-3.5 的文档。如果有人知道如何解决,请告诉我。

【问题讨论】:

  • 虽然关于如何安装 编程工具 的问题是热门话题,但我认为最好在 Ubuntu 问题网站上提问。

标签: r ubuntu ubuntu-18.04 rstan


【解决方案1】:

我遇到了同样的问题,我的同事也遇到了。 我们只是直接跳到安装,它工作正常。 简而言之:

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)

来源及更详细解释:https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#installation-of-rstan

【讨论】:

  • 谢谢你!安装R的3.5版本后我才能够解决这个问题。现在它可以工作了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-06-26
  • 2020-01-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-15
相关资源
最近更新 更多