@@ -61,10 +61,17 @@ 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 , new_data , time , as_vector = FALSE , ... ) {
6565 rlang :: check_installed(" prodlim" , version = " 2022.10.13" )
6666 rlang :: check_installed(" censored" , version = " 0.1.1.9002" )
6767
68+ if (lifecycle :: is_present(new_data )) {
69+ lifecycle :: deprecate_stop(
70+ " 1.2.0" ,
71+ " predict.censoring_model_reverse_km(new_data)"
72+ )
73+ }
74+
6875 res <- rep(NA_real_ , length(time ))
6976 if (length(time ) == 0 ) {
7077 return (res )
@@ -76,13 +83,7 @@ predict.censoring_model_reverse_km <- function(object, new_data = NULL, time, as
7683 time <- time [- is_na ]
7784 }
7885
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- }
86+ tmp <- purrr :: map_dbl(time , ~ predict(object $ fit , times = .x , type = " surv" ))
8687
8788 zero_prob <- purrr :: map_lgl(tmp , ~ ! is.na(.x ) && .x == 0 )
8889 if (any(zero_prob )) {
0 commit comments