Answers for "r dplyr add total row"

R
0

r dplyr add total row

x %>%
  bind_rows(summarise(.,
                      across(where(is.numeric), sum),
                      across(where(is.character), ~"Total")))
Posted by: Guest on February-17-2022

Browse Popular Code Answers by Language