i want to have the total cases in header itself with in the table. so the total number of responses can be included in table.
i want to have spss table type so i a using expsss here
df <- data.frame("TB1"=c("OPS", "OPS", "HR", "ADMIN", "HR", "ADMIN", "ADMIN", "HR", "HR", "HR", "Sales", "Sales", "Sales", "HR", "HR", "HR", "HR", "Sales", "Sales"),
"TB2"=c("Sales", "ADMIN", "ADMIN", "Sales", "ADMIN", "ADMIN", "ADMIN", "HR", "HR", "HR", "HR", "HR", "HR", "OPS", "OPS", "OPS", "OPS", "HR", "HR"),
"TB3"=c("ADMIN", "Sales", "OPS", "Sales", "HR", "ADMIN", "HR", "HR", "ADMIN", "ADMIN", "HR", "HR", "HR", "OPS", "HR", "OPS", "HR", "HR", "Sales"),
"TB4"=c("Global", "Regional", "Regional", "Global", "Global", "Regional", "Regional", "Global", "Global", "Regional", "Regional", "Global", "Global", "Regional", "Global", "Regional", "Global", "Regional", "Global"))
banner <- with(df, list(total(),TB4))
t1 <- tab1 <- expss::cro_cpct(df$TB1, banner)
required output