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)