Search code examples
rexpss

showing a table as is without any tab_stat_*()


As I am using expss to summarize my tables, I would like all other tables to look in the similar styling. So basically I have a dplyr summarized data frame and now I want to make it nicely formatted and labelled as expss style. This means I would not like to use any tab_stat_*() or say use a summarized table as is. Is this possible? So something like

dplyr_summary %>%
    expss::tab_rows(column1) %>%
    expss::tab_cells(column2) %>%
    expss::tab_cols(column3) %>%
    expss::tab_stat(NULL) %>%
    expss::tab_pivot() 

Thank you.


Solution

  • tab_stat_fun(identity) should work:

    dplyr_summary %>%
        expss::tab_rows(column1) %>%
        expss::tab_cells(column2) %>%
        expss::tab_cols(column3) %>%
        expss::tab_stat_fun(identity) %>%
        expss::tab_pivot() 
    

    You can also try as.etable function. It is suited for simple cases when you already have columns and rows labels and there is no need to reposition rows to column names.