HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

Rscript — Run a script with the R programming language. More information: <https://manned.org/Rscript>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandruncliprogrammingrscriptwithscript

Problem

How to use the Rscript command: Run a script with the R programming language. More information: <https://manned.org/Rscript>.

Solution

Rscript — Run a script with the R programming language. More information: <https://manned.org/Rscript>.

Run a script:
Rscript {{path/to/file.R}}


Run a script in vanilla mode (i.e. a blank session that doesn't save the workspace at the end):
Rscript --vanilla {{path/to/file.R}}


Execute one or more R expressions:
Rscript -e {{expression1}} -e {{expression2}}


Display version:
Rscript --version

Code Snippets

Run a script

Rscript {{path/to/file.R}}

Run a script in vanilla mode (i.e. a blank session that doesn't save the workspace at the end)

Rscript --vanilla {{path/to/file.R}}

Execute one or more R expressions

Rscript -e {{expression1}} -e {{expression2}}

Display version

Rscript --version

Context

tldr-pages: common/Rscript

Revisions (0)

No revisions yet.