@@ -61,10 +61,17 @@ predict.censoring_model <- function(object, ...) {
61
61
}
62
62
63
63
# ' @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 , ... ) {
65
65
rlang :: check_installed(" prodlim" , version = " 2022.10.13" )
66
66
rlang :: check_installed(" censored" , version = " 0.1.1.9002" )
67
67
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
+
68
75
res <- rep(NA_real_ , length(time ))
69
76
if (length(time ) == 0 ) {
70
77
return (res )
@@ -76,13 +83,7 @@ predict.censoring_model_reverse_km <- function(object, new_data = NULL, time, as
76
83
time <- time [- is_na ]
77
84
}
78
85
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" ))
86
87
87
88
zero_prob <- purrr :: map_lgl(tmp , ~ ! is.na(.x ) && .x == 0 )
88
89
if (any(zero_prob )) {
0 commit comments