Questions tagged «s»

10
如何按组获取摘要统计信息
我试图一次按类别列将R / S-PLUS中的多个摘要统计信息分组。我找到了几个函数,但是每个函数每个调用都做一个统计,比如`aggregate()。 data <- c(62, 60, 63, 59, 63, 67, 71, 64, 65, 66, 68, 66, 71, 67, 68, 68, 56, 62, 60, 61, 63, 64, 63, 59) grp <- factor(rep(LETTERS[1:4], c(4,6,6,8))) df <- data.frame(group=grp, dt=data) mg <- aggregate(df$dt, by=df$group, FUN=mean) mg <- aggregate(df$dt, by=df$group, FUN=sum) 我正在寻找的是在一次调用中获取同一组的多个统计信息,例如均值,最小值,最大值,标准,...等,这可行吗?
75 r  s 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.