Skip to content

Commit

Permalink
Merge pull request #1415 from tidymodels/table-input-formula-recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt authored Jan 22, 2025
2 parents 0375bab + df1112e commit 29d3871
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/recipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ recipe.formula <- function(formula, data, ...) {
cli::cli_abort("{.arg data} is missing with no default.")
}

if (is.table(data)) {
cli::cli_warn(
"Passing a table to {.fn recipe} is undocumented unsupported behavior.
This will no longer be possible in the next release of {.pkg recipes}."
)
data <- as_tibble(data)
}

if (!is.data.frame(data) && !is.matrix(data) && !is_sparse_matrix(data)) {
cli::cli_abort(
"{.arg data} must be a data frame, matrix, or sparse matrix,
Expand Down

0 comments on commit 29d3871

Please sign in to comment.