Day4-陆高平

R语言基础

1.下载R和Rstudio

1.1下载安装R语言

https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/base/R-4.0.5-win.exe

1.2 下载安装Rstudio

https://download1.rstudio.org/desktop/windows/RStudio-1.4.1106.exe

Snipaste_2021-04-22_22-27-37.png

2.认识R和Rstudio

2.1作图

> plot(rnorm(50))
Rplot.png
> boxplot(iris$Sepal.Length~iris$Species,col = c("lightblue","lightyellow","lightpink"))
Rplot.png

3.R语言基本操作

3.1显示文件列表

> dir()
[1] "lgp.txt.txt"   
[2] "shengxin.Rproj"
> list.files()
[1] "lgp.txt.txt"   
[2] "shengxin.Rproj"

3.2 加减乘除

> 3+8
[1] 11
> 3-8
[1] -5
> 3*8
[1] 24
> 3/8
[1] 0.375
> 3^8
[1] 6561

3.3赋值

> x<-3+8
> x
[1] 11

3.4删除变量

> a<-3
> b<-1
> c<-4
> u<-5+6
> rm(b)
> rm(u,c)
> rm(list=ls())

3.5清空控制台

ctrl+l

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容