从r中的'迷你表'创建表格

时间:2013-09-02 20:56:36

标签: r

我有一些代码,我希望能够将它组合成一个大表。这可能吗?

cbind(sum(michelson[michelson$Expt==1,]$Speed),
      mean(michelson[michelson$Expt==1,]$Speed),
      max(michelson[michelson$Expt==1,]$Speed))    

cbind(sum(michelson[michelson$Expt==2,]$Speed), 
      mean(michelson[michelson$Expt==2,]$Speed),
      max(michelson[michelson$Expt==2,]$Speed))    

cbind(sum(michelson[michelson$Expt==3,]$Speed),
      mean(michelson[michelson$Expt==3,]$Speed),
      max(michelson[michelson$Expt==3,]$Speed))    

cbind(sum(michelson[michelson$Expt==4,]$Speed),
      mean(michelson[michelson$Expt==4,]$Speed),
      max(michelson[michelson$Expt==4,]$Speed))   

cbind(sum(michelson[michelson$Expt==5,]$Speed),
      mean(michelson[michelson$Expt==5,]$Speed),
      max(michelson[michelson$Expt==5,]$Speed))

我很感谢一些专家的帮助!感谢

1 个答案:

答案 0 :(得分:1)

解释你想要实现的目标将有助于某人回答而不是只粘贴代码......从我的代码中可以理解,ddply似乎是正确的选择,正如@Henrik所指出的