Skip to content

Commit

Permalink
fix breaking change in survival 3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qmarcou committed Jun 28, 2024
1 parent c0392f9 commit 5b497bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/fit_netTPreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,13 @@ estimate_censoring_dist <-
# Use summary() to keep only times of censoring events
cens_fit <- summary(cens_fit, censored = FALSE)
# Add start time (time = s) censoring probability as first row
cens_surv <- tibble::tibble(time = cens_fit$time, surv = cens_fit$surv) %>%
cens_surv <- tibble::tibble(
# BUGFIX: as.double needed for survival >=3.7.0
# Otherwise empty data.frame columns are equivalent to c(), which is NULL
# and will be dropped by the tibble() constructor and add_row will crash
time = as.double(cens_fit$time),
surv = as.double(cens_fit$surv)
) %>%
tibble::add_row(time = 0.0, surv = 1.0, .before = 1)

return(cens_surv)
Expand Down

0 comments on commit 5b497bd

Please sign in to comment.