Skip to content

Commit dfa5062

Browse files
committed
removing new_data argument from predict.censoring_model_reverse_km()
1 parent 8c08c65 commit dfa5062

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

R/survival-censoring-model.R

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ predict.censoring_model <- function(object, ...) {
6161
}
6262

6363
#' @export
64-
predict.censoring_model_reverse_km <- function(object, new_data = NULL, time, as_vector = FALSE, ...) {
64+
predict.censoring_model_reverse_km <- function(object, time, as_vector = FALSE, ...) {
6565
rlang::check_installed("prodlim", version = "2022.10.13")
6666
rlang::check_installed("censored", version = "0.1.1.9002")
6767

@@ -76,13 +76,7 @@ predict.censoring_model_reverse_km <- function(object, new_data = NULL, time, as
7676
time <- time[-is_na]
7777
}
7878

79-
if (is.null(new_data)) {
80-
tmp <-
81-
purrr::map_dbl(time, ~ predict(object$fit, times = .x, type = "surv"))
82-
} else {
83-
tmp <-
84-
purrr::map_dbl(time, ~ predict(object$fit, newdata = new_data, times = .x, type = "surv"))
85-
}
79+
tmp <- purrr::map_dbl(time, ~ predict(object$fit, times = .x, type = "surv"))
8680

8781
zero_prob <- purrr::map_lgl(tmp, ~ !is.na(.x) && .x == 0)
8882
if (any(zero_prob)) {

0 commit comments

Comments
 (0)