Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rscript on ubuntu

Tags:

r

ubuntu

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.

like image 722
jkjk Avatar asked Nov 05 '11 19:11

jkjk


People also ask

Does R work on Ubuntu?

Run R scripts with RStudio in Ubuntu The most common way to use R is using RStudio, a great cross-platform open source IDE. You can install it using deb file in Ubuntu. Download the deb file from the link below. You'll have to scroll down a bit to locate the DEB files for Ubuntu.

What is Rscript in Linux?

Rscript is an R Interpreter which helps in the execution of R commands present in the script file. In this tutorial, we will learn basic syntax required to write R Script File and execute R Script File with Rscript command in Terminal / Console.


3 Answers

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
like image 77
Johnsyweb Avatar answered Sep 21 '22 21:09

Johnsyweb


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

like image 35
Kevin Avatar answered Sep 20 '22 21:09

Kevin


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.

like image 30
Ryan Szrama Avatar answered Sep 21 '22 21:09

Ryan Szrama