Skip to content

Commit

Permalink
Merge pull request #1027 from tidymodels/fix-1025
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt authored Nov 20, 2023
2 parents 1db4a8b + 5d47de6 commit e809d0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: parsnip
Title: A Common API to Modeling and Analysis Functions
Version: 1.1.1.9002
Version: 1.1.1.9003
Authors@R: c(
person("Max", "Kuhn", , "[email protected]", role = c("aut", "cre")),
person("Davis", "Vaughan", , "[email protected]", role = "aut"),
Expand Down
7 changes: 4 additions & 3 deletions R/standalone-survival.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@
.extract_surv_time <- function(surv) {
.is_surv(surv)
keepers <- c("time", "start", "stop", "time1", "time2")
res <- surv[, colnames(surv) %in% keepers]
if (NCOL(res) > 1) {
cols <- colnames(surv)[colnames(surv) %in% keepers]
res <- surv[, cols, drop = FALSE]
if (length(cols) > 1) {
res <- tibble::tibble(as.data.frame(res))
} else {
res <- unname(res)
res <- as.numeric(res)
}
res
}
Expand Down

0 comments on commit e809d0f

Please sign in to comment.