Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 summarise() 中使用 group_by() 函数,如下所示:
summarize(group_by(product),sum(Sales))
使用管道是最简单的方法,但如果您需要找到当前嵌套表单的问题,您需要将感兴趣的数据框(假设它是df)传递给 group_by。
代替:
利用:
summarize(group_by(df,product),sum(Sales))
第一个是这样的:
summarize(group_by(Species), mean(Petal.Length))
缺少虹膜的地方。