This is a list of CLI packages for the R language.
Please submit an issue or pull request to adjust the list. Add the package alphabetically to the relevant section.
Contents
| Package | CRAN | Downloads | Dependencies | Coverage | Note |
|---|---|---|---|---|---|
| argparse | Python dependency | ||||
| argparser | |||||
| arrg | |||||
| batch | |||||
| command | |||||
| defineOptions | |||||
| docopt | |||||
| getopt | |||||
| GetoptLong | Perl dependency | ||||
| optigrab | Archived on 2025-12-22 | ||||
| optparse | |||||
| minimist | Archived on 2022-08-20 | ||||
| Rapp | Rscript alternative | ||||
| rconfig | |||||
| ribiosArg | |||||
| scribe | |||||
| W4MRUtils | |||||
| Xmisc | Archived on 2022-06-13 |
There are a couple ways to run an R script script.R in a terminal with base R with the most popular way being Rscript:
Rscript script.R --foo R --file=script.R --args --foo
There are also a couple of alternative R scripting front-ends:
| Package | CRAN | Downloads | Dependencies | Coverage | Note |
|---|---|---|---|---|---|
| littler | Does not support commandArgs(trailingOnly = TRUE) |
||||
| Rapp | Syntax for parsing CLI arguments/options |
- When running an R script
script.Rwith Rscript the filename will be contained in the first--file=script.Rstring returned bycommandArgs(). - Many of the argument/option parser packages and R script front ends contain helper functions and or environmental variables to return this filename e.g.
getopt::getfile()and littler'sLITTLER_SCRIPT_PATHenvironmental variable but there exist some packages specialized in returning such filenames including from other contexts like calling a file withsource():
| Package | CRAN | Downloads | Dependencies | Coverage | Note |
|---|---|---|---|---|---|
| script | |||||
| scriptloc | |||||
| scriptName |
There are several packages to make graphics in the terminal:
| Package | CRAN | Downloads | Dependencies | Coverage | Note |
|---|---|---|---|---|---|
| bittermelon | |||||
| devoutansi | |||||
| NostalgiR | |||||
| plotcli | |||||
| ppcli | |||||
| rsixel | |||||
| terminalgraphics | |||||
| txtplot |
These packages can be used to manipulate the terminal and color/style terminal output:
| Package | CRAN | Downloads | Dependencies | Coverage | Note |
|---|---|---|---|---|---|
| cli | |||||
| cliapp | Superseded by cli | ||||
| climenu | |||||
| crayon | Superseded by cli | ||||
| colt | |||||
| cursr | |||||
| fansi | |||||
| keypress |
There are several packages to display tables in the terminal:
| Package | CRAN | Downloads | Dependencies | Coverage | Note |
|---|---|---|---|---|---|
| clitable | |||||
| colorDF | |||||
| emphatic | |||||
| formatters | |||||
| paint |