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