R - Statistical Computing
Contents

R语言是用于统计分析,图形表示和报告的编程语言和软件环境。本篇博客记录自学 R 的笔记和心得。
1. R Environment Install
R 环境的安装有多种方式,这儿用 conda 安装:
|
|
运行(检测)是否安装成功:
|
|
写第一个 R 程序:
|
|
2. Run R script
运行 R 脚本:gedit
or vim
test.R,写入下面语句:
|
|
用 Rscript 运行:
|
|
R 命令查询,例如不知道 hist
含义和用法:
|
|
3. Rstudio
gedit
或者 vim
有相应的 R 插件,但 Rstudio
是普遍认可最适合 R 的 IDE.
上 https://www.rstudio.com/products/rstudio/download 下载合适的版本(e.g. rstudio-1.4.1106-amd64.deb),然后:
|
|
Rstudio 因为图形桌面,可直接上手。选中内容用 ctrl + [enter] 可直接运行,tab 键支持补全。
R 语法高亮设置:Tools -> Global Options -> Code -> Display -> Highlight R function calls
Something interesting:
|
|
4. References
- R语言中文教程: https://www.w3cschool.cn/r/
- R语言官网: The R Project for Statistical Computing
- 学R,研究出版社,赵鹏,李怡著,2018.
- 学习R,人民邮电出版社,Richard Cotton,刘军(译),2014.
Author Qiang
LastMod 2021-05-03