Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export(discrim_flexible)
export(discrim_linear)
export(discrim_quad)
export(discrim_regularized)
export(ensure_parsnip_format)
export(eval_args)
export(extract_fit_engine)
export(extract_fit_time)
Expand Down
5 changes: 5 additions & 0 deletions R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ check_pred_type <- function(object, type, ..., call = rlang::caller_env()) {
#' tibbles.
#'
#' @param x A data frame or vector (depending on the context and function).
#' @param col_name A string for a prediction column name.
#' @param overwrite A logical for whether to overwrite the column name.
#' @return A tibble
#' @keywords internal
#' @name format-internals
Expand Down Expand Up @@ -336,6 +338,9 @@ format_hazard <- function(x) {
ensure_parsnip_format(x, ".pred")
}

#' @export
#' @rdname format-internals
#' @keywords internal
ensure_parsnip_format <- function(x, col_name, overwrite = TRUE) {
if (isTRUE(ncol(x) > 1) | is.data.frame(x)) {
x <- tibble::new_tibble(x)
Expand Down
7 changes: 7 additions & 0 deletions man/format-internals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading