Skip to content

Rstudio / gt / fmt_currency #1919

Answered by rich-iannone
cuentodeadas asked this question in Q&A
Discussion options

You must be logged in to vote

While the supplied code isn't reproducible (WS_subset_data isn't available here), we can work with a similar gtsummary example.

This table can be made with gtsummary and transformed into a gt table:

library(gtsummary)
library(gt)

gt_tbl <- 
  tbl_summary(
  trial,
  include = c(age, grade, response),
  by = trt, # split table by group
  missing = "no" # don't list missing data separately
) |> 
  add_n() |> # add column with total number of non-missing observations
  add_p() |> # test for a difference between groups
  modify_header(label = "**Variable**") |> # update the column header
  bold_labels() |>
  as_gt()

gt_tbl

One problem with working with this table is that we have no idea wh…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by cuentodeadas
Comment options

You must be logged in to vote
1 reply
@cuentodeadas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants