Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

how to add a totals row in r using mutate

library(janitor)
mtcars %>%
  tabyl(cyl, gear) %>%
  adorn_totals("row") 

   cyl  3  4 5
     4  1  8 2
     6  2  4 1
     8 12  0 2
 Total 15 12 5
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #totals #row #mutate
ADD COMMENT
Topic
Name
1+3 =