Skip to content

Commit

Permalink
Progress ticker for lmtp_survival, updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nt-williams committed Jun 28, 2024
1 parent 609cb61 commit 0c31ee3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions R/lmtp_survival.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#'
#' Wrapper around \code{lmtp_tmle} and \code{lmtp_sdr} for survival outcomes to estimate the entire survival curve.
#' Estimates are reconstructed using isotonic regression to enforce monotonicity of the survival curve.
#' \bold{Confidence intervals correspond to marginal confidence intervals for the survival curve, not simultaneous intervals.}
#'
#' @param data \[\code{data.frame}\]\cr
#' A \code{data.frame} in wide format containing all necessary variables
Expand Down Expand Up @@ -75,6 +76,8 @@ lmtp_survival <- function(data, trt, outcomes, baseline = NULL, time_vary = NULL
tau <- length(outcomes)
estimates <- vector("list", tau)

t <- 1
cli::cli_progress_step("Working on time {t}/{tau}...")
for (t in 1:tau) {
args <- list(
data = data,
Expand All @@ -101,8 +104,10 @@ lmtp_survival <- function(data, trt, outcomes, baseline = NULL, time_vary = NULL
else do.call(lmtp_sdr, args)
},
seed = TRUE)
cli::cli_progress_update()
}

cli::cli_progress_done()
estimates <- future::value(estimates)
estimates <- fix_surv_time1(estimates)
estimates <- isotonic_projection(estimates)
Expand Down
2 changes: 1 addition & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ print.lmtp_contrast <- function(x, ...) {

#' @export
print.lmtp_survival <- function(x, ...) {
as.data.frame(tidy.lmtp_survival(x))
print(as.data.frame(tidy.lmtp_survival(x)))
}
1 change: 1 addition & 0 deletions man/lmtp_survival.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0c31ee3

Please sign in to comment.