Qwraps2- row group label not showing up in summary table

1.2k Views Asked by At

Built a summary table, but the labels of the row groups are not showing up.

args(data)
summary1 <- list("Gender"= list("Female" 
             =~qwraps2::n_perc0(Sex==0, na_rm=TRUE))

table1 <- summary_table(data, summary1)

My table looks like this: table1:
table1

How do I get the "Gender" group name to show-up in the table?

2

There are 2 best solutions below

3
Peter On BEST ANSWER

It looks like you are viewing the table in RStuido via double clicking on the table1 in the "Environment" tab. The display is as expected. The structure of the qwraps2_summary_table object is a character matrix. In or outside of RStudio you can get the same result shown in the question post via View(table1).

To see the well rendered html you'll need to knit a .Rmd to html. Or, in RStuido you can upon a "R Notebook." A screen capture of of a simple example from an R Notebook follows:

enter image description here

2
Jakn09ab On

This may be related to how you "show" your table (You did not write anything about how you got it). When I use qwraps in rmarkdown in edit mode. When I just select the table (in your case table1) and press ctrl + enter I get the result you're asking for. If I use kable(table1) this removes this labelling.

I think the print() function recognized the qwrap table and prints it with the group names.

Ask a minimally reproducible example if you want more help.