Skip to content

Commit 8008f9c

Browse files
committed
refactor: use checkmate null coalesce instead of own function
1 parent 139e305 commit 8008f9c

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

R/breslow.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ breslow = function(times, status, lp_train, lp_test, eval_times = NULL, type = "
147147
})
148148

149149
# `eval_times` will be the sorted unique times (not just events)
150-
eval_times = sort(unique(eval_times %||% times))
150+
eval_times = sort(unique(eval_times %??% times))
151151
if (length(event_times) == 0L) {
152152
# 0 events (training data has only censored observations!)
153153
res = numeric(length(eval_times))

R/helpers.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ r6_private = function(x) {
5050
x$.__enclos_env__$private
5151
}
5252

53-
`%||%` = function(x, y) {
54-
if (is.null(x)) {
55-
y
56-
} else {
57-
x
58-
}
59-
}
60-
6153
## used for plotting
6254
apply_theme = function(theme_object, default_object = NULL) {
6355
if (getOption("mlr3.theme", TRUE)) theme_object else default_object %??% geom_blank()

R/surv_return.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
if (class(surv)[1L] == "array" && length(dim(surv)) != 3L) {
4848
stop("3D survival arrays supported only")
4949
}
50-
times = times %||% colnames(surv)
50+
times = times %??% colnames(surv)
5151
if (length(times) != ncol(surv)) {
5252
stop("'times' must have the same length as the 2nd dimension (columns of 'surv')")
5353
}

0 commit comments

Comments
 (0)