All Projects → ddsjoberg → Gtsummary

ddsjoberg / Gtsummary

Licence: other
Presentation-Ready Data Summary and Analytic Result Tables

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Gtsummary

Drake
An R-focused pipeline toolkit for reproducibility and high-performance computing
Stars: ✭ 1,301 (+189.11%)
Mutual labels:  r-package, reproducible-research, reproducibility, rstats
Targets
Function-oriented Make-like declarative workflows for R
Stars: ✭ 293 (-34.89%)
Mutual labels:  r-package, reproducible-research, reproducibility, rstats
Drake Examples
Example workflows for the drake R package
Stars: ✭ 57 (-87.33%)
Mutual labels:  reproducible-research, reproducibility, rstats
Metaflow
🚀 Build and manage real-life data science projects with ease!
Stars: ✭ 5,108 (+1035.11%)
Mutual labels:  r-package, reproducible-research, rstats
Datapackager
An R package to enable reproducible data processing, packaging and sharing.
Stars: ✭ 125 (-72.22%)
Mutual labels:  r-package, reproducibility, rstats
Git2rdata
An R package for storing and retrieving data.frames in git repositories.
Stars: ✭ 84 (-81.33%)
Mutual labels:  r-package, reproducible-research, rstats
Starters
R Package 📦 for initializing projects for various R activities 🔩
Stars: ✭ 111 (-75.33%)
Mutual labels:  r-package, reproducibility, rstats
reproducible
A set of tools for R that enhance reproducibility beyond package management
Stars: ✭ 33 (-92.67%)
Mutual labels:  reproducible-research, r-package, reproducibility
Ggpointdensity
📈 📊 Introduces geom_pointdensity(): A Cross Between a Scatter Plot and a 2D Density Plot.
Stars: ✭ 286 (-36.44%)
Mutual labels:  r-package, rstats
Rplos
R client for the PLoS Journals API
Stars: ✭ 289 (-35.78%)
Mutual labels:  r-package, rstats
Rhub
R-hub API client
Stars: ✭ 292 (-35.11%)
Mutual labels:  r-package, rstats
Rnoaa
R interface to many NOAA data APIs
Stars: ✭ 278 (-38.22%)
Mutual labels:  r-package, rstats
Rselenium
An R client for Selenium Remote WebDriver
Stars: ✭ 278 (-38.22%)
Mutual labels:  r-package, rstats
Rbook
Source files for "Learning Statistics with R"
Stars: ✭ 267 (-40.67%)
Mutual labels:  statistics, rstats
Ggextra
📊 Add marginal histograms to ggplot2, and more ggplot2 enhancements
Stars: ✭ 299 (-33.56%)
Mutual labels:  r-package, rstats
Sacred
Sacred is a tool to help you configure, organize, log and reproduce experiments developed at IDSIA.
Stars: ✭ 3,678 (+717.33%)
Mutual labels:  reproducible-research, reproducibility
Pdftools
Text Extraction, Rendering and Converting of PDF Documents
Stars: ✭ 349 (-22.44%)
Mutual labels:  r-package, rstats
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (-88.89%)
Mutual labels:  rstats, r-package
Assertr
Assertive programming for R analysis pipelines
Stars: ✭ 355 (-21.11%)
Mutual labels:  r-package, rstats
Tweetbotornot
🤖 R package for detecting Twitter bots via machine learning
Stars: ✭ 355 (-21.11%)
Mutual labels:  r-package, rstats

Codecov test coverage R build status CRAN status Lifecycle: maturing

gtsummary

The {gtsummary} package provides an elegant and flexible way to create publication-ready analytical and summary tables using the R programming language. The {gtsummary} package summarizes data sets, regression models, and more, using sensible defaults with highly customizable capabilities.

  • Summarize data frames or tibbles easily in R. Perfect for presenting descriptive statistics, comparing group demographics (e.g creating a Table 1 for medical journals), and more. Automatically detects continuous, categorical, and dichotomous variables in your data set, calculates appropriate descriptive statistics, and also includes amount of missingness in each variable.

  • Summarize regression models in R and include reference rows for categorical variables. Common regression models, such as logistic regression and Cox proportional hazards regression, are automatically identified and the tables are pre-filled with appropriate column headers (i.e. Odds Ratio and Hazard Ratio).

  • Customize gtsummary tables using a growing list of formatting/styling functions. Bold labels, italicize levels, add p-value to summary tables, style the statistics however you choose, merge or stack tables to present results side by side… there are so many possibilities to create the table of your dreams!

  • Report statistics inline from summary tables and regression summary tables in R markdown. Make your reports completely reproducible!

By leveraging {broom}, {gt}, and {labelled} packages, {gtsummary} creates beautifully formatted, ready-to-share summary and result tables in a single line of R code!

Check out the examples below, review the vignettes for a detailed exploration of the output options, and view the gallery for various customization examples.

Installation

The {gtsummary} package was written as a companion to the {gt} package from RStudio. You can install {gtsummary} with the following code.

install.packages("gtsummary")

Install the development version of {gtsummary} with:

remotes::install_github("ddsjoberg/gtsummary")

Examples

Summary Table

Use tbl_summary() to summarize a data frame.

animated

Example basic table:

library(gtsummary)
# make dataset with a few variables to summarize
trial2 <- trial %>% select(age, grade, response, trt)

# summarize the data with our package
table1 <- tbl_summary(trial2)

There are many customization options to add information (like comparing groups) and format results (like bold labels) in your table. See the tbl_summary() tutorial for many more options, or below for one example.

table2 <- 
  tbl_summary(
    trial2,
    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() 

Regression Models

Use tbl_regression() to easily and beautifully display regression model results in a table. See the tutorial for customization options.

mod1 <- glm(response ~ trt + age + grade, trial, family = binomial)

t1 <- tbl_regression(mod1, exponentiate = TRUE)

Side-by-side Regression Models

You can also present side-by-side regression model results using tbl_merge()

library(survival)

# build survival model table
t2 <-
  coxph(Surv(ttdeath, death) ~ trt + grade + age, trial) %>%
  tbl_regression(exponentiate = TRUE)

# merge tables 
tbl_merge_ex1 <-
  tbl_merge(
    tbls = list(t1, t2),
    tab_spanner = c("**Tumor Response**", "**Time to Death**")
  )

Review even more output options in the table gallery.

gtsummary + R Markdown

The {gtsummary} package was written to be a companion to the {gt} package from RStudio. But not all output types are supported by the {gt} package. Therefore, we have made it possible to print {gtsummary} tables with various engines.

Review the gtsummary + R Markdown vignette for details.

Contributing

Please note that the {gtsummary} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms. A big thank you to all contributors!
@ablack3, @aghaynes, @ahinton-mmc, @alexis-catherine, @anaavu, @angelgar, @arbet003, @arnmayer, @asshah4, @awcm0n, @barthelmes, @benediktclaus, @calebasaraba, @CarolineXGao, @CodieMonster, @ctlamb, @davidgohel, @davidkane9, @dax44, @ddsjoberg, @DeFilippis, @denis-or, @djbirke, @emilyvertosick, @ercbk, @gjones1219, @gorkang, @GuiMarthe, @hughjonesd, @IndrajeetPatil, @IsadoraBM, @j-tamad, @jalavery, @jeanmanguy, @jemus42, @jennybc, @JeremyPasco, @JesseRop, @jflynn264, @jjallaire, @joelgautschi, @JonGretar, @juseer, @jwilliman, @karissawhiting, @khizzr, @kmdono02, @larmarange, @leejasme, @ltin1214, @maia-sh, @margarethannum, @Marsus1972, @matthieu-faron, @mbac, @MelissaAssel, @michaelcurry1123, @moleps, @MyKo101, @oranwutang, @Pascal-Schmidt, @proshano, @raphidoc, @ryzhu75, @sammo3182, @sbalci, @simonpcouch, @slb2240, @slobaugh, @storopoli, @TarJae, @tjmeyers, @tormodb, @UAB-BST-680, @Uriahf, @zabore, @zachariae, @zeyunlu, and @zongell-star

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].