GSK-Biostatistics / tfrmt

r package for formatting tables
https://gsk-biostatistics.github.io/tfrmt/
Other
70 stars 8 forks source link

tfrmt tfrmt logo

R-CMD-check Codecov test
coverage status:
experimental CRAN
status

The tfrmt package provides a language for defining display-related metadata, which can then be used to automate and easily update output formats.

In clinical trials, displays are generally quite standard, but frequent, highly specific formatting tweaks (e.g., rounding, footnotes, headers) are very common. Prior to data analysis, study teams often generate mock displays to represent the desired end product for sponsors to approve or programmers to replicate. This process is typically highly manual and separate from the programming itself. There is also a high importance placed on verifying the accuracy of the results via a QC (Quality Control) process such as double programming. Finally, there is a movement toward an industry standard data structure for Analysis Results Data “ARD”, which means analysis results datasets will have consistent structures and column names. Specifically, the ARD is long, with 1 record per computed value. For more information about ARDs click here.

tfrmt supports a vision where:

By reducing the amount of repetitive tasks, study teams can focus on the quality and interpretation of the results themselves.

Why tfrmt?

While there are many existing table-making packages in the R ecosystem, they typically fall into one of two categories:

By design, tfrmt is more of the latter, as it is intended to be used after the results have been computed. What makes tfrmt unique, however, is that it offers an intuitive interface for defining and layering standard or custom formats that are often specific to clinical trials. It also offers the novel ability to easily generate mock displays using metadata that will be used for the actual displays. tfrmt is built on top of the powerful gt package, which is intended to support a variety of output formats in the future.

Installation

The development version of tfrmt can be installed with:

devtools::install_github("GSK-Biostatistics/tfrmt")

Input data structure

We expect an input dataset that is long, with 1 record per computed value. Required columns include:

Functionality

Here is an overview of what is possible with tfrmt:

Other benefits of tfrmt:

More Info

For more information about how to build your own tfrmt mocks/tables (like the one below!), please explore the vignettes.

Example GT Demography Table

Recorded Presentations and Shared Materials

R/Pharma 2022 Day 1: Christina Fillmore - Why do I spend all my life formatting tables?

R/Pharma 2023: Becca Krouse - Everyone’s Invited: A Case Study on Bridging the Usability Gap

R/Pharma 2022 Workshop: Christina Fillmore, Ellis Hughes, Thomas Neitmann - Clinical Reporting in R (Day 2)

R/Pharma 2023 Workshop: Thomas Neitmann, Pawel Rucki, Ellis Hughes - Leveraging and contributing to the the pharmaverse for clinical trial reporting in R