R语言分组计数

输入数据如下:

分组计数

tapply(cancer.type.gender$Count,list(cancer.type.gender$Gender,cancer.type.gender$Project),sum)

aggregate(x=cancer.type.gender[c('Count')], by = list(cancer.type.gender$Gender, cancer.type.gender$Project), FUN=sum)

by(cancer.type.gender$Count INDICES = list(cancer.type.gender$Project), FUN=sum)

tapply(cancer.type.gender$Count, INDEX=cancer.type.gender$Project, FUN=sum)

  

posted @ 2018-11-07 14:11  qinqinyang  阅读(7000)  评论(0编辑  收藏  举报