统计软件R入门.ppt

画图 plot(1,1,xlim=c(1,7.5),ylim=c(0,5),type=n) # Do not plot points points(1:7,rep(4.5,7),cex=1:7,col=1:7, pch=0:6) text(1:7,rep(3.5,7),labels=paste(0:6,letters[1:7]),cex=1:7, col=1:7) 画图(继续) points(1:7,rep(2,7), pch=(0:6)+7) # Plot symbols 7 to 13 text((1:7)+0.25, rep(2,7), paste((0:6)+7)) # Label with symbol number points(1:7,rep(1,7), pch=(0:6)+14) # Plot symbols 14 to 20 text((1:7)+0.25, rep(1,7), paste((0:6)+14)) # Labels with symbol number 写函数:中位数和均值的比值函数 用该函数计算一万个(均值为1的)指数分布的中位数和均值的比 median.mean.ratio - function(x) { return(median(x)/mean(x)) } z - rexp(10000) median.mean.ratio(z) 函

文档评论(0)

1亿VIP精品文档

相关文档