Skip to content

Commit c8229a1

Browse files
committed
small update to names for nested tibbles
1 parent 963ba95 commit c8229a1

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

R/predict.R

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ format_time <- function(x) {
254254
format_survival <- function(x) {
255255
if (isTRUE(ncol(x) > 1) | is.data.frame(x)) {
256256
x <- as_tibble(x, .name_repair = "minimal")
257-
if (!any(grepl("^\\.time", names(x)))) {
258-
names(x) <- paste0(".time_", names(x))
259-
}
257+
names(x) <- ".pred"
260258
} else {
261259
x <- tibble(.pred_survival = unname(x))
262260
}
@@ -270,9 +268,7 @@ format_linear_pred <- function(x) {
270268

271269
if (isTRUE(ncol(x) > 1) | is.data.frame(x)) {
272270
x <- as_tibble(x, .name_repair = "minimal")
273-
if (!any(grepl("^\\.time", names(x)))) {
274-
names(x) <- paste0(".time_", names(x))
275-
}
271+
names(x) <- ".pred_linear_pred"
276272
} else {
277273
x <- tibble(.pred_linear_pred = unname(x))
278274
}
@@ -283,9 +279,7 @@ format_linear_pred <- function(x) {
283279
format_hazard <- function(x) {
284280
if (isTRUE(ncol(x) > 1) | is.data.frame(x)) {
285281
x <- as_tibble(x, .name_repair = "minimal")
286-
if (!any(grepl("^\\.time", names(x)))) {
287-
names(x) <- paste0(".time_", names(x))
288-
}
282+
names(x) <- ".pred"
289283
} else {
290284
x <- tibble(.pred_hazard = unname(x))
291285
}

0 commit comments

Comments
 (0)