From 83a618af83db9f7c41d7d18a753fabeee0cdea24 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Tue, 21 Jan 2025 16:59:16 -0800 Subject: [PATCH 1/2] turn table to tibble in recipe.formula --- R/recipe.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/recipe.R b/R/recipe.R index e668e6607..f60961c34 100644 --- a/R/recipe.R +++ b/R/recipe.R @@ -209,6 +209,10 @@ recipe.formula <- function(formula, data, ...) { cli::cli_abort("{.arg data} is missing with no default.") } + if (is.table(data)) { + 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, From df1112efadb199f5323e2d5497acd60bfc820d16 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 22 Jan 2025 08:57:28 -0800 Subject: [PATCH 2/2] add warning --- R/recipe.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/recipe.R b/R/recipe.R index f60961c34..949711521 100644 --- a/R/recipe.R +++ b/R/recipe.R @@ -210,6 +210,10 @@ recipe.formula <- function(formula, data, ...) { } 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) }