如何找出数据框中符合特定标准的数据点数量?
Group<-c("Group 1","Group 1","Group 1","Group 2","Group 2")
Factor<-c("Factor 1", "Factor 1", "Factor 2", "Factor 1", "Factor 2")
data<-data.frame(cbind(Group,Factor))
data
例如,我想知道第 1 组因子 2 中有多少数据点。我想我应该能够使用该summary
函数,但我不知道如何指定我想要因子水平的组合。例如:
summary(data) #Verifies that Group 1 appears 3 times, and Factor 2 appears twice, but no information on how many times Group 1 AND Factor 2 appear in the same row
那么,如何获取不同因子水平组合的汇总表呢?