Skip to content

Commit 6616687

Browse files
authored
export ensure_parsnip_format (#1249)
* changes for #1238 * man file
1 parent 9f0ba3f commit 6616687

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export(discrim_flexible)
221221
export(discrim_linear)
222222
export(discrim_quad)
223223
export(discrim_regularized)
224+
export(ensure_parsnip_format)
224225
export(eval_args)
225226
export(extract_fit_engine)
226227
export(extract_fit_time)

R/predict.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ check_pred_type <- function(object, type, ..., call = rlang::caller_env()) {
271271
#' tibbles.
272272
#'
273273
#' @param x A data frame or vector (depending on the context and function).
274+
#' @param col_name A string for a prediction column name.
275+
#' @param overwrite A logical for whether to overwrite the column name.
274276
#' @return A tibble
275277
#' @keywords internal
276278
#' @name format-internals
@@ -336,6 +338,9 @@ format_hazard <- function(x) {
336338
ensure_parsnip_format(x, ".pred")
337339
}
338340

341+
#' @export
342+
#' @rdname format-internals
343+
#' @keywords internal
339344
ensure_parsnip_format <- function(x, col_name, overwrite = TRUE) {
340345
if (isTRUE(ncol(x) > 1) | is.data.frame(x)) {
341346
x <- tibble::new_tibble(x)

man/format-internals.Rd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)