Clinical Trial Simulation
Overview
Provides some basic routines for simulating a clinical trial. The primary intent is to provide some tools to generate trial simulations for trials with time to event outcomes. Piecewise exponential failure rates and piecewise constant enrollment rates are the underlying mechanism used to simulate a broad range of scenarios such as those presented in Lin et al. (2020) doi:10.1080/19466315.2019.1697738. However, the basic generation of data is done using pipes to allow maximum flexibility for users to meet different needs.
Major changes
- The heavy **gt** dependency is replaced by the lightweight **lt** package for rendering summary tables. The
lt()generic is re-exported sosummary()output can be rendered withlt()after only loading simtrial.as_gt()is deprecated but kept for one release; it still returns agt_tblobject and now requires the suggested **gt** package to be installed. (#371, thanks to @yihui)
Documentation
- Expanded the details for
sim_fixed_n()and updated vignettes for the current package interface (#358, thanks to @LittleBeannie).
Tests
- Hardened
sim_gs_n()andsummary.simtrial_gs_wlr()tests against upstream **gsDesign2** changes (#368, #369, thanks to @jdblischak).
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-17
- WARNING12 OK, 1 WARNING2026-10-01
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
Show 4 earlier changesHide 4 earlier changes
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-03-10
Documentation
- Help pages
- 38 (5 internal)includes a package overview page
- Examples that run
- 97%35 run in a plain check (7 of them under a condition) · 1 never run
- Exported functions with examples
- 96%
- Documented parameters
- 80%
- Return-value docs
- 96%
- Help pages citing references
- 26%
- Approximating an arbitrary hazard function HTML
- Basic tools for time-to-event trial simulation and testing HTML
- Computing p-values for Fleming-Harrington weighted logrank tests and the MaxCombo test HTML
- Custom Fixed Design Simulations: A Tutorial on Writing Code from the Ground Up HTML
- Note on potential discrepancies between simtrial and survdiff HTML
- Restricted mean survival time (RMST) HTML
- Simulate Fixed Designs with Ease via sim_fixed_n HTML
- Simulate Group Sequential Designs with Ease via sim_gs_n HTML
- Simulating time-to-event trials in parallel HTML
- TTE simulation data manipulations HTML
Show 1 moreHide 1 vignette
Downloads
Repository
- PRs merged (all time)
- 97%
- Median days to close, 50 most recently updated closed issues
- 17
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
9 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/merck/simtrial on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-01 · The repository has a site deploy workflow
pkgdown site last built 2026-10-01
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-05-18Pull request it wrote: opened by a project memberCommits: at least 2 crediting it in the message
- Claude Opus 4.61 commit · May 2026
- Claude Opus 4.81 commit · Sep 2026
Dependencies
Installing simtrial adds 14 packages (6 with compiled code, 11 MB of source tarballs). Heaviest: data.table 5.7 MB, Rcpp 1.8 MB, mvtnorm 1.0 MB.
CRAN will archive these unless their check problems are fixed by the date shown. This package needs each one to install.
- ltfix by Nov 7
Code & Tests
Datasets
People & History
Show 4 more contributorsHide 4 contributors
Pick two releases to compare their code metrics.
- 1.1.0Latest
- RR 4.6.0 released · 2026-04-24
- 1.0.22025-11-20 · diff ↗
- 1.0.12025-09-11 · diff ↗
- 1.0.02025-06-11 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.4.2
- 0.4.12024-05-03 · diff ↗ ·
removed 4 exports
early_zero_weight, fh_weight, mb_weight, pvalue_maxcomboadded 11 exports
create_cut, create_test, early_zero, fh, maxcombo, mb, milestone, multitest, rmst, sim_gs_n, wlr - RR 4.4.0 released · 2024-04-24
- 0.3.22023-12-11
- RR 4.3.0 released · 2023-04-21
Package metadata
- First published
- 2023-12-11
- Total releases
- 7 / 3 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 14 KB / 7 files
- Download size
- 1.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("simtrial")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.