《R语言入门与实践》学习笔记一(chapter1~3)
1 基本语句的使用
2 编写R脚本
3 编写自定义函数
![](https://images2017.cnblogs.com/blog/1147507/201801/1147507-20180105110309409-1231350127.png)
roll3 = function(){
d = 1: 6
//prob 改变出现的概率
di = sample(d,size = 2,replace = T,prob = c(1/8,1/8,1/8,1/8,1/8,3/8))
sum(di)
}
![](https://images2017.cnblogs.com/blog/1147507/201801/1147507-20180105110320190-735960862.png)
四 提到的命令
mean()
round()
sample()
args()
library()
qplot(x,y)
qplot(x,binwidth=1)