How to install R packages that are not available in quot;R-essentialsquot;?(如何安装“R-essentials中不可用的 R 包?)
问题描述
我使用开箱即用的 Anaconda 安装来使用 Python.现在我已经读到,也可以在此安装中包含"R 世界,并在 Jupyter/Ipython 笔记本中使用 IR 内核.
I use an out-of-the-box Anaconda installation to work with Python. Now I have read that it is possible to also "include" the R world within this installation and to use the IR kernel within the Jupyter/Ipython notebook.
我找到了安装许多著名 R 包的命令:conda install -c r r-essentials
I found the command to install a number of famous R packages: conda install -c r r-essentials
我的初学者问题:
如何安装 R-essential 包中未包含的 R 包?例如 CRAN 上可用的 R 包.pip"仅适用于 PyPI Python 包,不是吗?
How do I install R packages that are not included in the R-essential package? For example R packages that are available on CRAN. "pip" works only for PyPI Python packages, doesn't it?
推荐答案
现在我找到了文档:
这是解释如何生成仅在 CRAN 存储库中可用的 R 包的文档:https://www.continuum.io/content/conda-data-science
This is the documentation that explains how to generate R packages that are only available in the CRAN repository: https://www.continuum.io/content/conda-data-science
转到构建 conda R 包"部分.
Go to the section "Building a conda R package".
(提示:只要 R 包在 anaconda.org 下可用,请使用此资源.请参阅此处:https://www.continuum.io/blog/developer/jupyter-and-conda-r)
(Hint: As long as the R package is available under anaconda.org use this resource. See here: https://www.continuum.io/blog/developer/jupyter-and-conda-r)
alistaire 的回答是添加 R 包的另一种可能性:
alistaire's answer is another possibility to add R packages:
如果您通过常规 install.packages
(来自 CRAN 镜像)或 devtools::install_github
(来自 GitHub)从 R 内部安装包,它们可以正常工作.@alistaire
If you install packages from inside of R via the regular install.packages
(from CRAN mirrors), or devtools::install_github
(from GitHub), they work fine. @alistaire
如何做到这一点:打开你的(独立的)R 安装,然后运行以下命令:
How to do this: Open your (independent) R installation, then run the following command:
install.packages("png", "/home/user/anaconda3/lib/R/library")
将新包添加到 Jupyter 使用的正确 R 库中,否则该包将安装在 中提到的/home/user/R/i686-pc-linux-gnu-library/3.2/png/libs 中.libPaths() .
to add new package to the correct R library used by Jupyter, otherwise the package will be installed in /home/user/R/i686-pc-linux-gnu-library/3.2/png/libs mentioned in .libPaths() .
这篇关于如何安装“R-essentials"中不可用的 R 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何安装“R-essentials"中不可用的 R 包?


基础教程推荐
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 包装空间模型 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01