R at the Command-Line via 'r'

A scripting and command-line front-end is provided by 'r' (aka 'littler') as a lightweight binary wrapper around the GNU R language and environment for statistical computing and graphics. While R can be used in batch mode, the r binary adds full support for both 'shebang'-style scripting (i.e. using a hash-mark-exclamation-path expression as the first line in scripts) as well as command-line use in standard Unix pipelines. In other words, r provides the R language without the environment.

A scripting and command-line front-end for GNU R permitting use of R in command-line contexts.

#!/usr/bin/env r              ## for use in scripts
other input | r               ## for use in pipes
r somefile.R                  ## for running files
r -e 'expr'                   ## for evaluating expressions
r --help                      ## to show a quick synopsis

See the examples vignette for a full set of introductory examples. Also see the examples/ directory, as well as maybe the older tests directory both of which are installed with the package.

The package resides on the CRAN network and can be installed via


In general, simply running the script bootstrap will configure and build the executable. Running make install (possibly as sudo make install) will install the resulting binary.

On Linux systems, ensure you have the autotools-dev package (or its equivalent on non-Debian/Ubuntu systems). On OS X, you may need to run brew install automake autoconf to get all the tools.

On some operating systems such as OS X, r is not different from R. As this risk confusing the main binary R for the R system with our smaller scripting frontend r, we suggest to consider running configure --program-prefix="l" which this leads to installation of a binary lr instead of r.

As littler uses autoconf its AC_PATH_PROG() macro to find R, one can simply adjust the PATH when calling configure (or, rather, bootstrap) to have another version of R used. For example, on a server with R-devel in this location, the following builds littler using this R-devel version: PATH="/usr/local/lib/R-devel/bin/:$PATH" ./bootstrap.

For more information about littler, please see

(but note that the latter now overlaps with the example vignette).

Jeff Horner and Dirk Eddelbuettel

GPL (>= 2)


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.3.2 by Dirk Eddelbuettel, 9 months ago


Report a bug at https://github.com/eddelbuettel/littler/issues

Browse source code at https://github.com/cran/littler

Authors: Dirk Eddelbuettel and Jeff Horner

Documentation:   PDF Manual  

GPL (>= 2) license

Suggests knitr, docopt, rcmdcheck

System requirements: libR

See at CRAN