powered by
add_totals_row(dat, na.rm = TRUE)
library(dplyr) # for the %>% pipe mtcars %>% crosstab(am, cyl) %>% add_totals_row
Run the code above in your browser using DataLab