I have been running tables including tab_stat_cpct hoping to have col %'s appearing in the bottom row adding up to 100% in each column. But this is what I get...
mtcars %>%
tab_cells(am) %>%
tab_cols(total(),vs) %>%
tab_stat_cases(label = "N") %>%
tab_stat_cpct(label="%") %>%
tab_pivot(stat_position = "inside_rows") %>% drop_rc() %>%
split_table_to_df()
1 #Total vs
2 0 1
3 am 0 N 19 12 7
4 % 59 67 50
5 1 N 13 6 7
6 % 41 33 50
7 #Total cases N 32 18 14
8 % 32 18 14
They just repeat the total n of cases in each column, not the %. Is this a bug or am I doing something wrong in my code? Thanks.