#将data0数据按照ID计算样本量
library(dplyr)data_group<- group_by(data0, ID)data_GroupByID<- summarise(data_group,count = n())data_GroupByID<- data_GroupByID[order(data_GroupByID$count,decreasing=T),]#降序排序