R/scale_accrual.R

Defines functions .scale_accrual

#' Scenario with the accrual duration changed
#'
#' Scales the interval limits of an accrual given by proportions so that
#' the accrual duration becomes \code{duration}.
#'
#' @param scenario An \code{ms_scenario} object with \code{prop} accrual.
#' @param duration New accrual duration.
#' @return An \code{ms_scenario} object.
#' @noRd
.scale_accrual <- function(scenario, duration) {
  acc <- scenario$accrual
  f <- duration / acc$duration
  acc$time <- acc$time * f
  acc$duration <- duration
  scenario$accrual <- acc
  scenario
}

Try the DesignComplexSurvival package in your browser

Any scripts or data that you put into this service are public.

DesignComplexSurvival documentation built on Nov. 23, 2026, 5:07 p.m.