gtreg

Regulatory Tables for Clinical Research

https://github.com/shannonpileggi/gtreg

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 5 committers (20.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.5%) to scientific vocabulary

Keywords from Contributors

easy-to-use gt regression-models reproducibility summary-statistics summary-tables table1 tableone
Last synced: 10 months ago · JSON representation

Repository

Regulatory Tables for Clinical Research

Basic Info
Statistics
  • Stars: 37
  • Watchers: 3
  • Forks: 8
  • Open Issues: 13
  • Releases: 4
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct Support

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# gtreg 



[![R-CMD-check](https://github.com/shannonpileggi/gtreg/workflows/R-CMD-check/badge.svg)](https://github.com/shannonpileggi/gtreg/actions)
[![Codecov test coverage](https://codecov.io/gh/shannonpileggi/gtreg/branch/main/graph/badge.svg)](https://app.codecov.io/gh/shannonpileggi/gtreg?branch=main)
[![CRAN status](https://www.r-pkg.org/badges/version/gtreg)](https://CRAN.R-project.org/package=gtreg) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)



## Installation

You can install {gtreg} with the following code.

``` r
install.packages("gtreg")
```

You can install the development version of {gtreg} from [GitHub](https://github.com/shannonpileggi/gtreg) with:

``` r
# install.packages("devtools")
devtools::install_github("shannonpileggi/gtreg")
```

## Overview

The {gtreg} package creates tabular data summaries appropriate for regulatory submissions.
The package builds the tables using {gtsummary}.


Here are [slides](https://shannonpileggi.github.io/introducing-gtreg-rmed-2022/#/title-slide) and a [recorded talk (17 min)](https://youtu.be/DmslEfczYqM) from "Introducing {gtreg}: an R package to produce regulatory tables for clinical research" presented at the 2022 R in Medicine conference.

[![Screenshot of YouTube recording on title slide](man/figures/Introducing-gtreg-screenshot.png){width=70%}](https://youtu.be/DmslEfczYqM)

## Functions for adverse event (AE) reporting

**Summarize Raw Adverse Counts**

`tbl_ae_count()` provides counts of all AEs, and omits percentage statistics as multiple AEs 
 can occur per subject.
 

```{r example2}
library(gtreg)
tbl_ae_count <- 
  df_adverse_events |> 
  tbl_ae_count(
    ae = adverse_event,
    soc = system_organ_class, 
    by = drug_attribution
  ) |>
  add_overall(across = "by") |>
  modify_spanning_header(all_ae_cols() ~ "**Drug Attribution**") |>
  bold_labels()
```

```{r example-tbl_ae_count, include = FALSE}
# Had to manually save images in temp file, not sure if better way.
gt::gtsave(as_gt(tbl_ae_count), file = file.path(tempdir(), "temp2.png"))
```

```{r out.width = "76%", echo = FALSE}
# Have to do this workaround since the README needs markdown format for GitHub page but a different format for the website.
if (identical(Sys.getenv("IN_PKGDOWN"), "true")) {
  as_gt(tbl)
} else {
  knitr::include_graphics("man/figures/README-example-tbl_ae_count-1.png")
} 
```
 
**Summarize Adverse Events by Grade**

`tbl_ae()` counts one AE per subject by maximum grade; percentage statistics are provided by default with 
the denominators reflecting the number of patients in the study.

```{r example}
library(gtreg)
gtsummary::theme_gtsummary_compact()

tbl_ae <- 
  df_adverse_events |>
  tbl_ae(
    id_df = df_patient_characteristics,
    id = patient_id,
    ae = adverse_event,
    soc = system_organ_class, 
    by = grade, 
    strata = trt
  ) |>
  modify_header(all_ae_cols() ~ "**Grade {by}**") |> 
  bold_labels()
```

```{r example-tbl_ae, include = FALSE}
# Had to manually save images in temp file, not sure if better way.
gt::gtsave(as_gt(tbl_ae), file = file.path(tempdir(), "temp.png"))
```

```{r out.width = "100%", echo = FALSE}
# Have to do this workaround since the README needs markdown format for GitHub page but a different format for the website.
if (identical(Sys.getenv("IN_PKGDOWN"), "true")) {
  as_gt(tbl)
} else {
  knitr::include_graphics("man/figures/README-example-tbl_ae-1.png")
} 
```
 
 
**Focus on rates of high grade complications**
 
`tbl_ae_focus()` also counts one AE per subject by maximum grade, and is a convenience 
to summarize dichotomous AE attributes.
 

```{r example3}
tbl_ae_focus <- 
  df_adverse_events |>
  tbl_ae_focus(
    id_df = df_patient_characteristics,
    id = patient_id,
    ae = adverse_event,
    include = c(any_complication, grade3_complication)
  )
```

```{r example-tbl_ae_focus, include = FALSE}
# Had to manually save images in temp file, not sure if better way.
gt::gtsave(as_gt(tbl_ae_focus), file = file.path(tempdir(), "temp3.png"))
```

```{r out.width = "62%", echo = FALSE}
# Have to do this workaround since the README needs markdown format for GitHub page but a different format for the website.
if (identical(Sys.getenv("IN_PKGDOWN"), "true")) {
  as_gt(tbl)
} else {
  knitr::include_graphics("man/figures/README-example-tbl_ae_focus-1.png")
} 
```

## Other Functions for Clinical Reporting

**Regulatory summary**

`tbl_reg_summary()` creates a data summary table often seen in regulatory submissions.

```{r example4}
tbl_reg_summary <-
  df_patient_characteristics |>
  tbl_reg_summary(by = trt, include = c(marker, status)) 
```

```{r example-tbl_reg_summary, include = FALSE}
# Had to manually save images in temp file, not sure if better way.
gt::gtsave(as_gt(tbl_reg_summary), file = file.path(tempdir(), "temp4.png"))
```


```{r out.width = "42%", echo = FALSE}
# Have to do this workaround since the README needs markdown format for GitHub page but a different format for the website.
if (identical(Sys.getenv("IN_PKGDOWN"), "true")) {
  as_gt(tbl)
} else {
  knitr::include_graphics("man/figures/README-example-tbl_reg_summary-1.png")
} 
```

**Print an AE listing**

`tbl_listing()` creates a gtsummary-class listing of data to enable grouped printing.

```{r example5}
tbl_listing <-
  head(df_adverse_events, n = 10) |>
  select(system_organ_class, adverse_event, grade, drug_attribution, patient_id) |>
  dplyr::arrange(adverse_event, desc(grade)) |>
  tbl_listing(group_by = system_organ_class) |>
  bold_labels()
```

```{r example-tbl_listing, include = FALSE}
# Had to manually save images in temp file, not sure if better way.
gt::gtsave(as_gt(tbl_listing), file = file.path(tempdir(), "temp5.png"))
```


```{r out.width = "62%", echo = FALSE}
# Have to do this workaround since the README needs markdown format for GitHub page but a different format for the website.
if (identical(Sys.getenv("IN_PKGDOWN"), "true")) {
  as_gt(tbl)
} else {
  knitr::include_graphics("man/figures/README-example-tbl_listing-1.png")
} 
```



## Code of Conduct

Please note that the gtreg project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

Owner

  • Name: Shannon Pileggi
  • Login: shannonpileggi
  • Kind: user
  • Location: Doylestown, PA
  • Company: The Prostate Cancer Clinical Trials Consortium

Data Scientist

GitHub Events

Total
  • Issues event: 1
  • Issue comment event: 1
  • Push event: 2
  • Pull request review event: 1
  • Pull request event: 2
Last Year
  • Issues event: 1
  • Issue comment event: 1
  • Push event: 2
  • Pull request review event: 1
  • Pull request event: 2

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 159
  • Total Committers: 5
  • Avg Commits per committer: 31.8
  • Development Distribution Score (DDS): 0.509
Past Year
  • Commits: 7
  • Committers: 2
  • Avg Commits per committer: 3.5
  • Development Distribution Score (DDS): 0.286
Top Committers
Name Email Commits
Daniel Sjoberg d****g@g****m 78
Shannon Pileggi p****s@m****g 78
ksirohi7 8****7 1
Travis Gerke t****e@m****u 1
Meghan - The Tidy Trekker 6****a 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 63
  • Total pull requests: 48
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 12 days
  • Total issue authors: 8
  • Total pull request authors: 5
  • Average comments per issue: 1.21
  • Average comments per pull request: 1.4
  • Merged pull requests: 43
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • shannonpileggi (29)
  • ddsjoberg (29)
  • karissawhiting (1)
  • allegropiano (1)
  • vjcatharine (1)
  • mattkumar (1)
  • anddis (1)
  • rshinytools (1)
Pull Request Authors
  • ddsjoberg (30)
  • shannonpileggi (15)
  • tgerke (2)
  • ksirohi7 (1)
  • Meghansaha (1)
Top Labels
Issue Labels
documentation (4) enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 324 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 6
  • Total maintainers: 1
cran.r-project.org: gtreg

Regulatory Tables for Clinical Research

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 324 Last month
Rankings
Forks count: 8.3%
Stargazers count: 9.6%
Average: 27.6%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 55.0%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4 depends
  • broom.helpers >= 1.5.0 imports
  • cli >= 3.1.0 imports
  • dplyr >= 1.0.7 imports
  • forcats >= 0.5.1 imports
  • gtsummary >= 1.6.0.9011 imports
  • knitr >= 1.37 imports
  • purrr >= 0.3.4 imports
  • rlang >= 1.0.0 imports
  • stringr >= 1.4.0 imports
  • tibble >= 3.1.6 imports
  • tidyr >= 1.1.4 imports
  • covr >= 3.5.1 suggests
  • gt >= 0.3.1 suggests
  • rmarkdown * suggests
  • spelling >= 2.2 suggests
  • testthat >= 3.1.1 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite