@@ -20,6 +20,10 @@ epi_recipe.default <- function(x, ...) {
20
20
if (is.matrix(x ) || is.data.frame(x ) || tibble :: is_tibble(x )) {
21
21
x <- x [1 , , drop = FALSE ]
22
22
}
23
+ cli_warn(
24
+ " epi_recipe has been called with a non-epi_df object, returning a regular recipe. Various
25
+ step_epi_* functions will not work."
26
+ )
23
27
recipes :: recipe(x , ... )
24
28
}
25
29
@@ -147,6 +151,10 @@ epi_recipe.formula <- function(formula, data, ...) {
147
151
data <- data [1 , ]
148
152
# check for minus:
149
153
if (! epiprocess :: is_epi_df(data )) {
154
+ cli_warn(
155
+ " epi_recipe has been called with a non-epi_df object, returning a regular recipe. Various
156
+ step_epi_* functions will not work."
157
+ )
150
158
return (recipes :: recipe(formula , data , ... ))
151
159
}
152
160
@@ -333,15 +341,11 @@ update_epi_recipe <- function(x, recipe, ..., blueprint = default_epi_recipe_blu
333
341
# ' illustrations of the different types of updates.
334
342
# '
335
343
# ' @param x A `epi_workflow` or `epi_recipe` object
336
- # '
337
344
# ' @param which_step the number or name of the step to adjust
338
- # '
339
345
# ' @param ... Used to input a parameter adjustment
340
- # '
341
346
# ' @param blueprint A hardhat blueprint used for fine tuning the preprocessing.
342
347
# '
343
- # ' @return
344
- # ' `x`, updated with the adjustment to the specified `epi_recipe` step.
348
+ # ' @return `x`, updated with the adjustment to the specified `epi_recipe` step.
345
349
# '
346
350
# ' @export
347
351
# ' @examples
@@ -383,17 +387,15 @@ adjust_epi_recipe <- function(x, which_step, ..., blueprint = default_epi_recipe
383
387
384
388
# ' @rdname adjust_epi_recipe
385
389
# ' @export
386
- adjust_epi_recipe.epi_workflow <- function (
387
- x , which_step , ... , blueprint = default_epi_recipe_blueprint()) {
390
+ adjust_epi_recipe.epi_workflow <- function (x , which_step , ... , blueprint = default_epi_recipe_blueprint()) {
388
391
recipe <- adjust_epi_recipe(workflows :: extract_preprocessor(x ), which_step , ... )
389
392
390
393
update_epi_recipe(x , recipe , blueprint = blueprint )
391
394
}
392
395
393
396
# ' @rdname adjust_epi_recipe
394
397
# ' @export
395
- adjust_epi_recipe.epi_recipe <- function (
396
- x , which_step , ... , blueprint = default_epi_recipe_blueprint()) {
398
+ adjust_epi_recipe.epi_recipe <- function (x , which_step , ... , blueprint = default_epi_recipe_blueprint()) {
397
399
if (! (is.numeric(which_step ) || is.character(which_step ))) {
398
400
cli :: cli_abort(
399
401
c(" `which_step` must be a number or a character." ,
0 commit comments