ubuntu 上的 Rscript

发布于 2024-12-13 21:18:21 字数 68 浏览 6 评论 0原文

我可以从哪里安装 Rscript?我需要使用 exec 从 php 文件运行 R 脚本。不过我需要先安装 Rscript。

Where can I install Rscript from? I need to run an R script from a php file using exec. However I need to install Rscript first.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

能怎样 2024-12-20 21:18:21

R 的主包名为 r-base 。有关脚本和命令行前端,请参阅 littler (或 r-cran-littler 中xenial (16.04LTS) 及更高版本):

sudo apt-get install littler

The main package for R is called r-base. For the scripting and command-line front-end see littler (or r-cran-littler in xenial (16.04LTS) and beyond):

sudo apt-get install littler
我不在是我 2024-12-20 21:18:21

搜索 ubuntu 存储库。您检查过 littler 包吗?

Search the ubuntu repositories. Have you checked the littler package?

半仙 2024-12-20 21:18:21

到目前为止发布的答案通常很有用,但它们并没有直接回答问题。我最近有同样的问题,发现 Ubuntu 没有 rscript 二进制文件。 r 二进制文件本身用于以批处理模式执行脚本,而不是我在 OS X 中使用的单独的 rscript 二进制文件。

看来您可以从其他来源获取 rscript 二进制文件(请参阅 http://craig-russell.co.uk/2012/05/08/install-r-on-ubuntu.html#.UwKWzkJdW2Q ),但我不确定当从命令行简单运行“r script.r”就可以正常工作时,为什么您需要它。

The answers posted so far are generally useful, but they don't directly answer the question. I recently had the same question and discovered there is no rscript binary for Ubuntu. The r binary itself is used to execute scripts in batch mode as opposed to the separate rscript binary that I was using in OS X.

It appears you may be able to get an rscript binary from other sources (see http://craig-russell.co.uk/2012/05/08/install-r-on-ubuntu.html#.UwKWzkJdW2Q for example), but I'm not sure why you would need that when simple running "r script.r" from the command line works just fine.

×眷恋的温暖 2024-12-20 21:18:21

我尝试在全新的 ubuntu 安装(16.04.2 LTS)中运行 Rscript 并得到:

当前未安装程序“Rscript”。您可以通过键入以下内容来安装它:
sudo apt install r-base-core

因此,很自然地,我运行了 sudo apt install r-base-core

安装花了几分钟。

后来,我需要安装一个 R 包,并意识到我需要一个 R shell。运行 r 返回:

当前未安装程序“r”。您可以通过键入以下内容来安装它:
sudo apt install r-cran-littler

我再次遵循,这次速度相当快。

我不知道这些是否是正确的步骤(或者为什么它们会是错误的),但这就是系统引导我做的。

I tried running Rscript in a fresh ubuntu installation (16.04.2 LTS) and got:

The program 'Rscript' is currently not installed. You can install it by typing:
sudo apt install r-base-core

so, naturally, i ran sudo apt install r-base-core.

installation took a couple of minutes.

Later, i needed to install an R package, and realized i needed an R shell for that. running r returned:

The program 'r' is currently not installed. You can install it by typing:
sudo apt install r-cran-littler

Again, i followed, this time it was quite faster.

I don't know if these are the correct steps to take (or why they would be wrong), but it's what the system led me to do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文