Case studies and industry use cases

R Package Snapshots for Clinical Trial Submissions

Isabella Velásquez's head shot
Written by Isabella Velásquez
2023-01-13
A laptop displays the Posit Package Manager interface, showing usage statistics and download trends for various packages. To the left, a green panel has "BLOG SERIES" at the top and "Posit Team 101" prominently in the center. At the bottom of the green panel, the Posit Package Manager logo is visible.

Did you know that in 2024, the U.S. Food and Drug Administration (FDA) reviewed a pilot submission conducted entirely with R, submitted by the R Consortium? The R Submission Pilot 3 used a Posit Public Package Manager (P3M) Snapshot.

The date-based snapshot in P3M played a vital part in the submission because, in the world of clinical trials, reproducibility and transparency are paramount. Researchers and regulators must ensure they can precisely recreate the computational environments used to analyze trial data. Repository snapshots ensure this reproducibility and provide complete transparency.

R, the popular programming language for statistical computing and graphics, offers a refined package ecosystem that enables researchers to perform sophisticated analyses and visualize their results. However, relying on future versions of packages, like those that will be available when a researcher wants to reproduce your work, can introduce variability, making it challenging to reproduce analyses and ensure consistency in clinical trial submissions.

To address this challenge, the R Consortium R Submission Pilot 3 referenced a date-based repository snapshot in P3M. Snapshots—specific versions of a repository frozen in time—capture the exact versions of packages used during the pilot and serve as a reference point for recreating clinical trial environments. By including a frozen URL that references a date-based snapshot, researchers make it transparent which software was used, while guaranteeing that regulators can access the exact package versions used in their analyses to replicate their work, eliminating concerns about compatibility issues or unexpected changes in package behavior.

P3M plays a pivotal role in capturing and managing R repository snapshots. It provides a centralized service from which users can access the latest versions of packages. Moreover, P3M allows users to access packages from past snapshots to recreate trial environments.

Users can explore the available snapshots and their respective package versions in P3M athttps://packagemanager.posit.co/. These repositories and their date-based snapshots serve as valuable resources for researchers aiming to document clinical trial analyses or investigate historical package behavior.

By default, P3M users installing packages from P3M will get the latest and greatest. Importantly, they will also get precompiled binaries of CRAN packages for macOS, Linux & Windows. However, there are instances where it becomes crucial to install packages from a specific point in the past.

The R FDA submission used packages available from the snapshot as of March 15, 2023. Interested researchers can view the submission on the team’s GitHub repo.

You can recreate this environment locally by (1) setting the repo in RStudio via the Global Options, (2) using renv::restore(), or (3) editing your .Rprofile with this line:

options(repos = c(REPO_NAME = "https://packagemanager.posit.co/cran/2023-03-15"))

Ryan Johnson created a helpful video showing viewers how to set up the snapshot environment by editing the .Rprofile file:

While P3M provides public snapshots, pharmaceutical companies often require more control over packages or the ability to work offline. In such cases, managing internal custom repositories becomes crucial.

For a package manager with even more features, like vulnerability reporting and blocking, curated CRAN repositories, air-gapped use, or custom repositories to share private packages behind your organization’s firewall, check out the commercially licensed Posit Package Manager. Repositories in Posit Package Manager allow organizations to curate specific packages and package versions and ensure compliance with internal policies.

Leverage date-based snapshots for reproducibility and transparency

Whether you’re involved in clinical research or simply interested in the world of packages, understanding and using date-based snapshots can significantly enhance the reproducibility of your work.

Interested in using Posit Package Manager to transparently share the software you used in your submission as a reproducible snapshot? Schedule a demo today.

Isabella Velásquez's head shot

Isabella Velásquez

Sr. Product Marketing Manager at Posit, PBC
Isabella is a content strategist, data enthusiast, and author. Her goal is to drive engagement around all the awesome things happening at Posit.