mutate and rowSums exclude columns

后端 未结 2 1556
醉梦人生
醉梦人生 2021-01-18 09:54

Similar to: mutate rowSums exclude one column but in my case, I really want to be able to use select to remove a specific column or set of columns

I\'m

2条回答
  •  旧时难觅i
    2021-01-18 10:31

    @akrun provided already a relevant link about this problem. As about dplyr solution, I would actually use do:

    d %>%
      do({
        .$Total <- rowSums(select(., -Epsilon, -Alpha))
        .
      })
    

提交回复
热议问题