且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

按 R 中的不同列值求和

更新时间:2023-11-26 22:06:22

我认为***的方法是在 dplyr

I think the neatest way to do this is in dplyr

library(dplyr)
shop %>% 
  group_by(shop_id, shop_name, city) %>% 
  summarise_all(sum)