30-Day Course
Clinical SAS → R
Day 30 of 30·ADaM, TLFs & Advanced Topics

Capstone: An End-to-End Open-Source Submission Pipeline

Putting raw-to-SDTM-to-ADaM-to-TLF together — and your transition roadmap.

Learning objectives

  • 1Assemble the full pharmaverse pipeline in one project.
  • 2Organize a study repository and run order.
  • 3Plan a phased SAS-to-R adoption strategy.
  • 4Identify resources for continued learning.

Key SAS® → R comparison

TaskSAS®R
Whole studySAS macro frameworkpharmaverse project + renv
Run orderdriver programtargets / a run script
Deliverablesdatasets+TLFs+definesame, fully open-source

Code examples

Project run order
SAS®
/* %run_sdtm; %run_adam; %run_tlf; */
R
# 01_sdtm.R   -> dplyr + admiral + xportr
# 02_adam.R   -> admiral (ADSL, ADLB, ADAE)
# 03_tlf.R    -> rtables/tern/gtsummary + ggplot2
# 04_qc.R     -> diffdf + testthat
# renv.lock pins every package version

Note: A clear, numbered run order plus a lockfile makes the whole study reproducible by anyone, anywhere.

Explanation

The capstone ties the course together: a single reproducible project that takes raw data through SDTM, ADaM, and TLFs using the pharmaverse stack, validated with diffdf and testthat and pinned with renv. This is a credible, fully open-source alternative to a SAS macro framework.

Practically, most teams transition in phases — piloting R for QC or for a single domain first, then expanding — so your roadmap should pick a low-risk entry point, build internal validated functions, and grow from there. Pharmaverse, the R Consortium, and the RStudio/Posit clinical resources are excellent places to continue.

Practice exercise

Assemble a small end-to-end project: numbered scripts for SDTM, ADaM and TLF, an renv lockfile, and a QC script — then write a one-page transition plan identifying the first workflow you would move from SAS to R at your organization.