接著將data frame 以 group_by 分組之後,再以 summarise_all 配合 sum 以加總的方式合併重複的列: # 分組加總 df %>% group_by(x) %>% summarise_all(sum)
確定! 回上一頁