r - 安装 Anaconda 后无法安装 R 包

标签 r jupyter

我一直在 RStudio 中使用 R,安装包从来没有问题。我最近安装了 Anaconda 以将 Jupyter Notebook 用于协作项目。但是,在 Jupyter notebook 中使用 R 时,我无法安装除 r-essentials 中的软件包以外的软件包。 .问题似乎来自 Anaconda 安装的 R。当我尝试

install.packages("cubature", repos = 'http://cran.us.r-project.org')

在其 R 控制台中,我收到以下错误
Warning: unable to access index for repository http://cran.us.r-project.org/src/
contrib:
  internet routines cannot be loaded
Warning message:
package ‘cubature’ is not available (for R version 3.4.1) 

关注此 post ,我尝试“将新包添加到 Jupyter 使用的正确 R 库中”,但收到相同的错误。我试图从 Github 安装软件包,但我需要 devtools ,不在 r-essentials 中因此需要安装到。我还尝试使用 rpy2 导入 R 包如本 post 中所建议的,但内核干脆死了。

尽管如此,我仍然没有使用 RStudio 安装软件包的问题。我的(有问题的)R 版本是
>R.Version()
$platform
[1] "x86_64-apple-darwin13.4.0"
$arch
[1] "x86_64"
$os
[1] "darwin13.4.0"
$system
[1] "x86_64, darwin13.4.0"
$status
[1] ""
$major
[1] "3"
$minor
[1] "4.1"
$year
[1] "2017"
$month
[1] "06"
$day
[1] "30"
$`svn rev`
[1] "72865"
$language
[1] "R"
$version.string
[1] "R version 3.4.1 (2017-06-30)"
$nickname
[1] "Single Candle"

有什么建议?谢谢你的帮助!

最佳答案

您可以通过右下角的 Packages 选项卡(在 Files、Plots 等旁边)更新 RStudio 中的 r 包。
Rstudio screenshot

关于r - 安装 Anaconda 后无法安装 R 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46286084/

相关文章:

python - django-extensions shell_plus --kernel 指定连接文件

jupyter - 如何制作 nbconvert 自定义模板

python - 如何修复 .ipynb 文件?

apache-spark - 从 ubuntu 服务器运行 Jupyter notebook 我被 ssh 进入

r - R中并排的多个条形图

r - 在交互式 map 上叠加 shapefile 或栅格

jupyter-notebook - 如何通过命令行在 jupyter hub 中重启服务器?

r - kable 缩进所有列具有特定 hspace 的行

r - 为什么R中的fuzzyjoin比data.table慢

r - 使用 R 计算每列缺失值的百分比