A clinical trial end-to-end pipeline demonstrating
reproducrwithrenv— the complete reproducibility stack for regulated analytical workflows.
See the full walkthrough: DEMO.md
| reproducr-example | this repo | |
|---|---|---|
| Domain | Ecology / penguins | Clinical trials / oncology |
renv |
No | Yes |
| Report style | minimal | pharma |
| Analysis | Linear regression, CV | Survival, Cox PH, log-rank |
| Outputs certified | 12 | 20 |
| Intended audience | General R users | Biostatisticians, CROs, pharma |
Together they demonstrate that reproducr is environment-agnostic — it works
with or without renv, across domains, and at any level of regulatory rigour.
renv.lock ← survival 3.7-0 pinned (renv's job)
.reproducr.rds ← HR = 0.582 certified (reproducr's job)
renv ensures the same packages are installed on every machine and every
CI run. reproducr ensures those packages produce the same numerical results.
They solve different problems and belong together.
A simulated Phase III oncology trial (n = 400) comparing Treatment vs Control.
- Primary endpoint: Overall survival
- Design: Two-arm RCT, 1:1 randomisation
- Covariates: Age, sex, ECOG performance status
- Follow-up: 6–36 months
| Control | Treatment | |
|---|---|---|
| N | 206 | 194 |
| Events | 136 (66%) | 95 (49%) |
| Median OS | 13.7 months | 22.7 months |
| 12-month survival | 56.8% | 67.3% |
HR (Treatment vs Control): 0.582 (95% CI: 0.446–0.760, p < 0.001)
Log-rank test: χ² = 13.931, p = 0.000190
library(reproducr)
source("analysis.R")
# renv = TRUE reads versions from renv.lock
report <- audit_script("analysis.R", renv = TRUE, verbose = FALSE)
risks <- risk_score(report)
print(risks)
#>
#> -- reproducr risk score --
#>
#> No risks detected. All checks passed.certify(OUTPUTS, tag = "baseline-v1", script = "analysis.R")
#> reproducr: certified 20 output(s) [2026-06-01] under tag 'baseline-v1'
check_drift(OUTPUTS, against = "latest")
#>
#> -- reproducr drift check vs 'baseline-v1' --
#>
#> Verdict : ALL OUTPUTS MATCH
#> OK : 20
#> Drifted : 0repro_report(report, risks, drift = drift,
format = "html",
style = "pharma",
output_file = "qc_report.html")Generates a self-contained HTML QC document with execution environment, package inventory, risk register, drift assessment, and sign-off fields — suitable for regulatory submission.
The GitHub Actions workflow runs on every push to main and weekly:
setup-renv@v2restores the locked environment fromrenv.lock- Sources
analysis.Rto produceOUTPUTS - Audits with
audit_script(renv = TRUE)— versions from lockfile - Checks drift against last certified run
- Certifies the current run
- Generates
reproducibility_report.mdin pharma style - Updates the badge and commits
# 1. Restore the locked environment
renv::restore()
# 2. Install reproducr
install.packages("remotes")
remotes::install_github("repro-stats/reproducr")
# 3. Run the analysis
source("analysis.R")
# 4. Full reproducr pipeline
library(reproducr)
report <- audit_script("analysis.R", renv = TRUE, verbose = FALSE)
risks <- risk_score(report)
certify(OUTPUTS, tag = "local-run")
check_drift(OUTPUTS, against = "local-run")
repro_report(report, risks, format = "html", style = "pharma",
output_file = "qc_report.html")library(reproducr)
list_certs()The .reproducr.rds file is committed to version control and accumulates
a certification record on every CI run — providing a complete,
timestamped audit trail.
This is a companion repository to the
reproducr R package,
demonstrating the full pipeline in a clinical trial context with renv.
See also: reproducr-example
(ecology example, no renv) for a simpler starting point.