Skip to content

trtswitch

0.2.8Package record

Treatment Switching

0packages depend
6.1Kdownloads / year
59.6%test coverage
13/13flavors OK

Overview

About

Implements rank preserving structural failure time model (RPSFTM), iterative parameter estimation (IPE), inverse probability of censoring weights (IPCW), marginal structural model (MSM), simple two-stage estimation (TSEsimp), and improved two-stage estimation with g-estimation (TSEgest) methods for treatment switching in randomized clinical trials.

Changes in 0.2.8
  • added summary methods for rpsftm, ipe, tsesimp, tsegest, ipcw, and msm with analysis populations, ordered TSD 24 reporting checklists, model parameter estimates, treatment effect estimates, weight summaries where applicable, and bootstrap summaries
  • added matched function calls to rpsftm, ipe, tsesimp, tsegest, ipcw, and msm output; MSM summaries distinguish exclusion of post-switching data from switching models and inclusion of post-switching data in the weighted outcome model
  • expanded rpsftm, ipe, tsesimp, tsegest, ipcw, and msm summaries with guidance to inspect relevant model diagnostics and plots, alongside reporting items requiring external justification or separately fitted sensitivity analyses
  • added pre-filter missingness summaries for AFT-model covariates in tsesimp and switching-model covariates in tsegest, ipcw, and msm, grouped by treatment arm and relevant model candidates
  • added p_kmstar to plot.ipe and added p_km_switch to plot.tsesimp and plot.tsegest
  • added data_switch and km_switch to tsesimp output
  • added a small positive value to avoid zero time in survival_analysis.cpp

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 13.3 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK12 OK2026-04-25
  • NOTE12 OK, 2 NOTE2026-04-22
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
Show 1 earlier changeHide 1 earlier change
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.2.8
READMEYes · 71 wordsVignettesYes · 6 · dynamicNEWSYes · 100% structured · mentions 0.2.8Citation fileNoWebsiteYes · pkgdown
Help pages
69 (32 internal)includes a package overview page
Examples that run
96%24 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
100%
Documented parameters
99%
Return-value docs
100%
Help pages citing references
25%

Downloads

6.1K
CRAN downloads in the past year
Rank #5,425 · ~17/day · ~507/mo
Daily download trend is not available in this view yet.
61030 days
1.5K90 days
6.1K1 year
Compare downloads with other packages →
Also on465 r2u3 autocran

Repository

2Stars
2Forks
1Open issues
0Open PRs
0Releases
622Commits
2Commit identities
622 commits · Last activity 2026-09-26 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
20
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-10-14 · 12026-07-07 · 2
PracticesBeta

6 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/kaifenglu/trtswitch on 2026-10-18.

Continuous integration (1)
GitHub Actions
Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-09-26 · The repository has a site deploy workflow

pkgdown site last built 2026-09-26

Reproducibility and dev environment (1)
data-raw/
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
16 external dependencies (excludes base and recommended)

Installing trtswitch adds 23 packages (11 with compiled code, 38 MB of source tarballs). Heaviest: BH 14 MB, ggplot2 6.0 MB, data.table 5.7 MB.

Depends (1)
R >= 3.5
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (1)
Author, Maintainer since 0.1.0 (2024)
Releases (19)

Pick two releases to compare their code metrics.

Show 8 earlier eventsHide 8 earlier events
  • 0.1.4
    record
    2025-03-20 · diff ↗
  • 0.1.3
    record
    2025-02-06 · diff ↗ ·
    added 1 export
    kmdiff
  • 0.1.2
    record
    2024-12-05 · diff ↗
  • unarchivedReturned to CRAN
    2024-11-02
  • 0.1.1
    record
    2024-11-02 · diff ↗ ·
    added 1 export
    survsplit
  • archivedRemoved from CRAN
    2024-11-01
    issues were not corrected in time
  • 0.1.0
    record
    2024-10-17
  • R
    R 4.4.0 released · 2024-04-24

Package metadata

First published
2024-10-17
Total releases
19 / 2 yrs
License
GPL (>= 2) OSI
Minimum R
≥ 3.5
Bundled data
140 KB / 12 files
Download size
621 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("trtswitch")
Lu, K. (2026). trtswitch: Treatment Switching (Version 0.2.8) [Computer software]. https://doi.org/10.32614/CRAN.package.trtswitch

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for trtswitch version 0.2.8 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy