R语言(介绍).pptVIP

  • 32
  • 0
  • 约1.47万字
  • 约 74页
  • 2015-10-24 发布于河南
  • 举报
R语言(介绍)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 4 Apply函数 不用Apply: get.mean=function(x) + { + report=rep(0,4) + for(i in 1:4) + report[i]=mean(x[,i]) + report + } data(iris) get.mean(iris) [1] 5.843333 3.057333 3.758000 1.199333 用Apply函数: get.mean(iris) [1] 5.843333 3.057333 3.758000 1.199333 apply(iris[,1:4],2,mean) Sepal.Length Sepal.Width Petal.Length Petal.Width 5.843333 3.057333 3.758000 1.199333 第五章 统计模型 1 回归模型 lm(因变量~自变量+自变量+…[-1]) data(faithful) attach(faithful) nam

文档评论(0)

1亿VIP精品文档

相关文档