使用aggregate()来实现分组计数,使用length(x)来计算向量中元素的个数,该函数会把重复值计算N次:. aggregate(cut~color,diamonds,length).
確定! 回上一頁