Skip to content

trialr

Clinical Trial Designs in 'rstan'

v0.1.6 · Mar 12, 2023 · GPL (>= 3)

Description

A collection of clinical trial designs and methods, implemented in 'rstan' and R, including: the Continual Reassessment Method by O'Quigley et al. (1990) <doi:10.2307/2531628>; EffTox by Thall & Cook (2004) <doi:10.1111/j.0006-341X.2004.00218.x>; the two-parameter logistic method of Neuenschwander, Branson & Sponer (2008) <doi:10.1002/sim.3230>; and the Augmented Binary method by Wason & Seaman (2013) <doi:10.1002/sim.5867>; and more. We provide functions to aid model-fitting and analysis. The 'rstan' implementations may also serve as a cookbook to anyone looking to extend or embellish these models. We hope that this package encourages the use of Bayesian methods in clinical trials. There is a preponderance of early phase trial designs because this is where Bayesian methods are used most. If there is a method you would like implemented, please get in touch.

Downloads

CRAN

670

Last 30 days

5021st

1.7K

Last 90 days

8.1K

Last year

Trend: +51.9% (30d vs prior 30d)

r2u CRAN

30

Last 30 days

161

Last 90 days

547

Last year

Trend: -36.2% (30d vs prior 30d)

autoCRAN

3

Last 7 days

10

Last 30 days

2

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 8, 2026
ERROR r-devel-linux-x86_64-debian-gcc

whether package can be installed

Installation failed.
See ‘/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/trialr.Rcheck/00install.out’ for details.
OK 12 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 25, 2026
NOTE 11 OK · 3 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 22, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is 135.3Mb
  sub-directories of 1Mb or more:
    doc     3.9Mb
    libs  130.3Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 127.1Mb
  sub-directories of 1Mb or more:
    doc     3.9Mb
    libs  122.2Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is 12.0Mb
  sub-directories of 1Mb or more:
    doc    3.9Mb
    libs   7.0Mb
ERROR 10 OK · 3 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 18, 2026
ERROR r-devel-windows-x86_64

whether package can be installed

Installation failed.
See 'd:/Rcompile/CRANpkg/local/4.6/trialr.Rcheck/00install.out' for details.
NOTE r-oldrel-macos-arm64

installed package size

installed size is 135.3Mb
  sub-directories of 1Mb or more:
    doc     3.9Mb
    libs  130.3Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 127.1Mb
  sub-directories of 1Mb or more:
    doc     3.9Mb
    libs  122.2Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is 12.0Mb
  sub-directories of 1Mb or more:
    doc    3.9Mb
    libs   7.0Mb
NOTE 11 OK · 3 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is 135.3Mb
  sub-directories of 1Mb or more:
    doc     3.9Mb
    libs  130.3Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 127.1Mb
  sub-directories of 1Mb or more:
    doc     3.9Mb
    libs  122.2Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is 12.0Mb
  sub-directories of 1Mb or more:
    doc    3.9Mb
    libs   7.0Mb

Code

Structure

Lines of code

29,512

Files

246

Compiled share

22.8%

Has compiled src

Yes

Language breakdown

R 5,339 (18.1%)C/C++/src 6,721 (22.8%)Tests 2,811 (9.5%)Docs 4,238 (14.4%)Vignettes 10,403 (35.3%)

API

Exported functions

55

Internal functions

33

Recent export changes

v0.1.5+3 efftox_priors, get_efftox_priors, stan_nbg
v0.1.3+5 eff_at_dose, n_at_dose, total_weight_at_dose +2 more

Testing & CI

Has tests

Yes

Test-to-code ratio

0.53

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

87.3%

\dontrun example ratio

51.1%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

37.5%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5.0

System requirements

1

C++ standard

C++14

License

GPL (>= 3)

License flags

SPDX valid, OSI approved

History

Versions

14

First release

2017-11-21

Latest release

2023-03-12

Avg cadence

66 days

Cold removal rate

100%

Dep drift

15

LOC over versions

v0.0.1: 11,672 LOCv0.0.2: 18,910 LOCv0.0.3: 18,910 LOCv0.0.4: 19,145 LOCv0.0.5: 19,146 LOCv0.0.6: 19,146 LOCv0.0.7: 19,148 LOCv0.1.0: 14,303 LOCv0.1.1: 19,126 LOCv0.1.2: 20,813 LOCv0.1.3: 21,319 LOCv0.1.4: 21,561 LOCv0.1.5: 22,823 LOCv0.1.6: 29,512 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Reverse Dependencies (6)

Dependency Network

Dependencies Reverse dependencies Rcpp rstan rstantools rlang dplyr purrr magrittr stringr ggplot2 gtools coda tidybayes tibble binom MASS VisCov brms.mmrm escalation historicalborrowlong networkscaleup phase12designs trialr

Version History

15 tracked
new 0.1.6 Mar 10, 2026
updated 0.1.6 ← 0.1.5 diff Mar 11, 2023
updated 0.1.5 ← 0.1.4 diff Oct 15, 2020
updated 0.1.4 ← 0.1.3 diff Apr 5, 2020
updated 0.1.3 ← 0.1.2 diff Jan 7, 2020
updated 0.1.2 ← 0.1.1 diff Jun 24, 2019
updated 0.1.1 ← 0.1.0 diff May 24, 2019
updated 0.1.0 ← 0.0.7 diff Apr 20, 2019
updated 0.0.7 ← 0.0.6 diff Mar 2, 2019
updated 0.0.6 ← 0.0.5 diff Jan 16, 2019
updated 0.0.5 ← 0.0.4 diff Nov 11, 2018
updated 0.0.4 ← 0.0.3 diff Oct 23, 2018
updated 0.0.3 ← 0.0.2 diff Aug 8, 2018
updated 0.0.2 ← 0.0.1 diff Aug 7, 2018
new 0.0.1 Nov 20, 2017