diff --git a/DESCRIPTION b/DESCRIPTION index 36e1c205e..74d371b82 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: parsnip Title: A Common API to Modeling and Analysis Functions -Version: 1.1.1.9001 +Version: 1.1.1.9002 Authors@R: c( person("Max", "Kuhn", , "max@posit.co", role = c("aut", "cre")), person("Davis", "Vaughan", , "davis@posit.co", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 17cd0f6a8..aa4137e3e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -20,6 +20,8 @@ * Fixed bug where `boost_tree()` models couldn't be fit with 1 predictor if `validation` argument was used. (#994) +* When computing censoring weights, the resulting vectors are no longer named (#1023). + # parsnip 1.1.0 This release of parsnip contains a number of new features and bug fixes, accompanied by several optimizations that substantially decrease the time to `fit()` and `predict()` with the package. diff --git a/R/standalone-survival.R b/R/standalone-survival.R index 708d43efa..a75464e85 100644 --- a/R/standalone-survival.R +++ b/R/standalone-survival.R @@ -17,6 +17,9 @@ # # 2023-06-14 # * removed time to factor conversion +# +# 2023-11-09 +# * make sure survival vectors are unnamed. # @param surv A [survival::Surv()] object # @details @@ -74,6 +77,8 @@ res <- surv[, colnames(surv) %in% keepers] if (NCOL(res) > 1) { res <- tibble::tibble(as.data.frame(res)) + } else { + res <- unname(res) } res } @@ -88,6 +93,6 @@ (identical(un_vals, 1:2) | identical(un_vals, c(1.0, 2.0))) ) { res <- res - 1 } - res + unname(res) } # nocov end