简体   繁体   English

如何像在 Windows 上一样在 Linux 上安装 R 包二进制文件?

[英]How to install R package binaries on Linux just like on Windows?

When I run install.packages("somepkg") on Linux (Ubuntu mostly), the installation process invovled building the R package from source which can be time consuming.当我在 Linux(主要是 Ubuntu install.packages("somepkg")上运行install.packages("somepkg")时,安装过程涉及从源代码构建 R 包,这可能很耗时。 Also it can be prone to failure due to missing development related Linux packages.此外,由于缺少与开发相关的 Linux 软件包,它也很容易失败。

Is there a way to install compiled binaries like on Windows?有没有办法像在 Windows 上一样安装已编译的二进制文件? I heard that it can be done, but couldn't find an easy to understand resource.听说可以,但是找不到容易理解的资源。 Hope by asking here I will make the answer (if it exists) more googlable.希望通过在这里提问,我会让答案(如果存在)更易于搜索。

It depends on whether binaries exist .这取决于二进制文件是否存在 Which, in turn, depends on which Linux distro and version you are running.而这又取决于Linux系统,以及你所运行。

For Ubuntu 18.04 (and later, as they are compatible), you can use the Rutter PPAs which cover over four thousand CRAN package.对于 Ubuntu 18.04(以及更高版本,因为它们兼容),您可以使用涵盖四千多个 CRAN 包的 Rutter PPA。 This is described (albeit very briefly) at the top of this README at CRAN .在 CRAN 的自述文件的顶部有描述(尽管非常简短)。

I also blogged about that (a few times) below my r4/ tag -- and because it didn't really "stick" amplified it again with short video plus slides, see this post .我还在我的r4/标签下写了(几次)关于它的博客——并且因为它并没有真正“坚持”用短视频和幻灯片再次放大它,请参阅这篇文章 The video runs for about 5 mins during which we install rstan and tidyverse as binaries each with just one command and it takes about a good minute each (depending on bandwidth and disk speed, of course) pulling all dependencies in pre-built and in a fail-safe manner.视频运行大约 5 分钟,在此期间我们将rstantidyverse安装为二进制文件,每个文件只用一个命令每个文件大约需要一分钟(当然,取决于带宽和磁盘速度)将所有依赖项拉入预构建和故障安全方式。

If this matches your needs, give it a try and please come to to the r-sig-debian list for questions.如果这符合您的需求,请尝试一下,请到r-sig-debian列表提问。

If you are on a different Linux flavor then I unfortunately less sure if a comparable service exists.如果您使用的是不同的 Linux 风格,那么不幸的是,我不太确定是否存在类似的服务。

Edit on 2020-09-17 As this was just upvoted and I was thus reminded of it, you now have better options and can get Linux binaries via install.packages("pkgname") .于 2020-09-17 编辑,因为这只是被点赞,所以我被提醒了,你现在有更好的选择,可以通过install.packages("pkgname")获取Linux 二进制文件 One way is RSPM, the other is BSPM.一种方式是 RSPM,另一种方式是 BSPM。 I have a first comparison blog post comparing both here (even with animated gif movies ;-)) and should be able to say more about BSPM "soon".我有第一篇比较博客文章在这里比较了两者(即使是动画 gif 电影 ;-))并且应该能够“很快”多说 BSPM。

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

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