讲课记录
文章平均质量分 55
yuxiboh
这个作者很懒,什么都没留下…
展开
-
R1 Lecture 04 Class Notes
R1_04 编程基础:控制流&函数入门by YU,XiangMar 24 2015控制流(判断和循环)判断 if,else,ifelseif(statement) { do ... } else { do else... }练习1写一个if else语句,功能是: 当y是偶数时,打印出y的一半,当y是奇数时,打印出3y+1y <- 17 if(y%%2==0) print(y/2)原创 2015-03-30 15:40:55 · 465 阅读 · 0 评论 -
R1 Lecture 02 Class Notes
R1 Lecture 2 Class Notesby YU,XiangMar 10, 2015R数据结构 向量 矩阵 数组 列表 数据框 向量向量的生成c(2,4,6,7,8)## [1] 2 4 6 7 812:30## [1] 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30seq(from=3,to=50,by=2)## [1原创 2015-03-30 12:35:24 · 514 阅读 · 0 评论 -
R1 Lecture 05 Class Notes
R1 Lecture 05 Class Notesby YU,XiangMar 31 2015简单编程前N个数的平方和# 用 for 循环的做法 f1 <- function(N){ s <- 0 for(i in 1:N){ s <- s+i^2 } s }# 用 while 循环的做法 f2 <- function(N){ s <- 0原创 2015-03-31 15:49:10 · 629 阅读 · 0 评论 -
R1 Lecture 07 Class Notes
R1 Lecture 07b Class NotesBy YU,XiangApr 14 2015常用统计图形直方图 条形图折线图 散点图饼图箱线图barplotDescription: Creates a bar plot with vertical or horizontal bars.Usage: barplot(height, ...) ## Default S3 me原创 2015-04-18 13:45:01 · 627 阅读 · 0 评论 -
R1 Lecture 06 Class Notes
R1 Lecture 06 Class NotesYU,XiangApr 7 2015作业答疑fib2 <- function(N){ f <- c(1,1) i <- 1 while(f[i]+f[i+1]<=N){ f[i+2] <- f[i]+f[i+1] i <- i+1 } f }开方的实现写一个函数 sqrt2 <原创 2015-04-11 22:13:11 · 601 阅读 · 0 评论 -
R1 Lecture 09 Class Notes
R1 Lecture 09 Class Notes 苹果盘子问题解答apple_dish <- function(N){ x <- sample(3,4*N,replace=TRUE) apple <- matrix(x,ncol=4) result <- apply(apple,1,f1) table(result)/N }f1 <- function(x){原创 2015-04-28 16:15:29 · 451 阅读 · 0 评论 -
R1 Lecture 10 Class Notes
R1 Lecture 10 Class NotesBy YU, XiangMay 5 2015假设检验: 均值Student’s t-testOne-sample t-test理论基础1.为了做单样本t检验,需要计算 tt 统计量的值:t=x¯−μ0s/n‾‾√ t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}} x¯\bar{x} 是样本均值(sample mean), ss原创 2015-05-07 21:11:30 · 625 阅读 · 0 评论 -
R1 Lecture 08 Class Notes
R1 Lecture 08 Class NotesBy YU, XiangApr 21 2015直线 线段 曲线 高级绘图函数 低级绘图函数plot , curve , hist , barplot , pie , boxplotpoints , lines , segments , abline , polygonR内置的概率分布一些概率分布函数名称,前缀 * = d,p,q,r === R原创 2015-04-22 16:38:47 · 601 阅读 · 0 评论