我有这行代码,但不知道用于创建表比例的参数下面的命令:
list(aggregate(df[,xx], by=list(df[,yy]), FUN=proportions)发布于 2020-11-20 22:29:27
如果我们正在创建proportions表,那么在proportions (或prop.table)中使用table
proportions(table(df[c('xx', 'yy')]))如果我们只需要使用aggregate
transform(aggregate(xx ~ yy, df, FUN = length), prop = xx/sum(xx))https://stackoverflow.com/questions/64937745
复制相似问题