← 返回命令列表

Linux command

r 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start R interpreter

R

Run script

R --file=[script.R]

Execute and print

Rscript -e "[print(1+1)]"

Run script silently

R --slave --file=[script.R]

No save on exit

R --no-save

说明

R is a language and interactive environment for statistical computing, data analysis, and graphics. It provides a wide variety of statistical techniques including linear and nonlinear modeling, time-series analysis, classification, and clustering, along with a powerful system for producing publication-quality plots and visualizations. The interactive console supports exploratory data analysis with immediate feedback, while scripts can be executed non-interactively via --file or through the companion Rscript command. R's package ecosystem on CRAN offers thousands of contributed libraries extending its capabilities across fields from bioinformatics to econometrics. The workspace system saves objects between sessions, though --no-save and --vanilla flags allow clean stateless execution for reproducible workflows.

参数

--file _FILE_
Execute script.
--slave
Silent mode.
--no-save
Don't save workspace.
--vanilla
No init files.
-e _EXPR_
Execute expression.

FAQ

What is the r command used for?

R is a language and interactive environment for statistical computing, data analysis, and graphics. It provides a wide variety of statistical techniques including linear and nonlinear modeling, time-series analysis, classification, and clustering, along with a powerful system for producing publication-quality plots and visualizations. The interactive console supports exploratory data analysis with immediate feedback, while scripts can be executed non-interactively via --file or through the companion Rscript command. R's package ecosystem on CRAN offers thousands of contributed libraries extending its capabilities across fields from bioinformatics to econometrics. The workspace system saves objects between sessions, though --no-save and --vanilla flags allow clean stateless execution for reproducible workflows.

How do I run a basic r example?

Run `R` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --file _FILE_ do in r?

Execute script.