Calculate cell percents and row percents (default is column-wide).Sort variables by significance ( sort_p()) sort categorical variables by frequency.Use custom functions for calculating p-values and reporting any statistic for continuous variables (including user-written functions).You can use them to do all sorts of things to your tables, like: Themes to format your table for specific journal/aesthetic requirements! tbl_cross() to make beautiful cross tables.tbl_survfit() function to summarize survival models.tbl_uvregression() to make tables summarizing univariable regression models (input a dataset, specify model and parameters… make a UVA regression table easily!).There are a few other functions we’d like you to know about! Gt :: tab_header( "Table 1: Baseline Characteristics") %>% Tbl_summary_5 % # create a gtsummary table tbl_summary(by = trt) %>% # convert from gtsummary object to gt object as_gt() %>% # modify with gt functions Continue formatting as a gt table with any.Convert the table to a gt object with the.gt), every function compatible that object will be available to use!Įxample workflow and code using gt customization: Once you convert a gtsummary object to another kind of object (e.g. It’s natural a gtsummary package user would want to customize the aesthetics of the table with some of the many functions available in the print engines listed above. Review the gtsummary + R Markdown vignette for details. Therefore, we have made it possible to print gtsummary tables with various engines. The gtsummary package was written to be a companion to the gt package from RStudio.īut not all output types are supported by the gt package (yet!). The pattern of what is reported can be modified with the pattern = argument.ĭefault is pattern = ")". Inline_text(tbl_reg_1, variable = trt, level = "Drug B") Any statistic reported in a gtsummary table can be extracted and reported in-line in a R Markdown document with the inline_text() function. Tables are important, but we often need to report results in-line in a report. Tab_spanner = c( "**Tumor Response**", "**Time to Death**") Tbl_reg_3 % tbl_regression(exponentiate = TRUE) Install gtsummary from CRAN with the following code: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |