Home > Software engineering >  R gtsummary package doesnt show the factor levels in the summary table
R gtsummary package doesnt show the factor levels in the summary table

Time:12-26

I have dataset like the following

> head(n2)
# A tibble: 6 x 4
  Pain  Redness Swelling Tiredness
  <fct> <chr>   <chr>    <chr>    
1 Yes   No      No       Yes      
2 No    No      No       No       
3 Yes   No      No       Yes      
4 Yes   No      Yes      Yes      
5 No    No      No       No       
6 No    No      No       No        

I am trying to make a summary table using gt_summary package. But in the summary table it is not showing the "Yes"/ "No" levels of Pain, Redness or Swelling variables, but rather it just shows the count of Yes of each columns. Can someone please help to show the "Yes"/ "No" levels in the table I am attaching the image of summary table created by gt_summary here.

CodePudding user response:

We could use type argument of tbl_summary(). See here: enter image description here

  • Related