简体   繁体   English

使用“conda”从 github 安装 R 包

[英]install R package from github using "conda"

any one can suggest how to use conda in Linux to install R package from github?任何人都可以建议如何在 Linux 中使用conda从 github 安装 R 包?

Thanks!谢谢!

According to this: https://github.com/conda/conda/issues/6674 You can create your own conda skeleton of a github derived R-package much as you would for a CRAN package.根据此: https ://github.com/conda/conda/issues/6674 您可以创建自己的 github 派生 R 包的 conda 框架,就像创建 CRAN 包一样。

Try doing尝试做

conda skeleton cran <github_url>

conda build --R=<my_r_version> r-<lower-case-package-name>

Then upload the built conda package to your own anaconda repository.然后将构建好的conda包上传到自己的anaconda仓库中。 This will fail if any of the dependencies of the package are absent from the anaconda repos that you have access to.如果您有权访问的 anaconda 存储库中缺少包的任何依赖项,这将失败。 So you might have to conda-build a few other packages along the way.因此,您可能必须在此过程中使用 conda-build 构建一些其他包。

Alternatively, you could install it directly with devtools::install_github(github_url, dependencies = FALSE) .或者,您可以直接使用devtools::install_github(github_url, dependencies = FALSE)安装它。 If you do go down this route, please ensure that any conda-available dependencies for the github package are already installed.如果你确实走这条路,请确保已经安装了 github 包的任何可用的 conda 依赖项。

If you don't use dependencies = FALSE R will install.packages a bunch of updates.如果你不使用dependencies = FALSE R 将安装install.packages一堆更新。 (As far as I can tell) When you install.packages a pre-installed package some_package in a conda env (eg, to update it) and then check conda list <some_package> on your current env, it will show the version that was installed by conda, rather than the updated version. (据我所知)当你 install.packages 一个预安装的包some_package在一个 conda 环境中(例如,更新它)然后检查你当前环境中的conda list <some_package> ,它会显示那个版本由 conda 安装,而不是更新版本。


Edited build command, following @rpanai s suggestion按照@rpanai 的建议编辑构建命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM