An Elegant Approach to Summarizing Clinical Data

Streamlines the analysis of clinical data by automatically selecting appropriate statistical descriptions and inference methods based on variable types. For method details see Motulsky H J (2016) < https://www.graphpad.com/guides/prism/10/statistics/index.htm> and d'Agostino R B (1971) .


tidysummary

The goal of tidysummary is to streamlines the analysis of clinical data by automatically selecting appropriate statistical descriptions and inference methods based on variable types. See the vignette for more details.

Installation

You can install the development version of tidysummary like so:

if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}
remotes::install_github("htqqdd/tidysummary")

Usage

A quick example

library(tidysummary)
result <- iris %>%
  add_var() %>%
  add_summary() %>%
  add_p()

Another example

#Here is an prepared dataset
iris <- iris %>%
  mutate(group = factor(rep(1:3, each = 50),
                        labels = c("group1", "group2", "group3")))

#Now use tidysummary
library(tidysummary)
result <- iris %>%
  add_var() %>%
  add_summary(binary_show = "all") %>%
  add_p()

Following options

  • Use as DataFrame
View(result)
  • Display as HTML (use kableExtra or others your prefer)
library(kableExtra)
result[is.na(result)] <- ""
result %>%
  kbl(caption = "Table 1. Summary of Iris Dataset",
      row.names = F,
      align = "c") %>%
  kable_classic(full_width = FALSE, html_font = "Cambria")

  • Save as Excel (.xlsx)
result %>%
  writexl::write_xlsx("./test.xlsx")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("tidysummary")

0.1.0 by Xiang Li, a year ago


Browse source code at https://github.com/cran/tidysummary


Authors: Xiang Li [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports car, cli, dplyr, fBasics, glue, qqplotr, rlang, stats, stringr, tibble, tidyplots, tidyr

Suggests knitr, rmarkdown


See at CRAN