mirror of
https://github.com/msberends/AMR.git
synced 2026-02-09 10:32:53 +01:00
(v3.0.1.9005) re-add tidymodels implementation
This commit is contained in:
@@ -966,8 +966,13 @@ get_current_data <- function(arg_name, call) {
|
||||
# an element `.data` will be in the environment when using dplyr::select()
|
||||
return(env$`.data`)
|
||||
} else if (valid_df(env$training)) {
|
||||
# an element `training` will be in the environment when using some tidymodels functions such as `prep()`
|
||||
return(env$training)
|
||||
if (!is.null(env$x) && valid_df(env$x$template)) {
|
||||
# an element `x$template` will be in the environment when using some tidymodels functions such as `prep()`
|
||||
return(env$x$template)
|
||||
} else {
|
||||
# this is a fallback for some tidymodels functions such as `prep()`
|
||||
return(env$training)
|
||||
}
|
||||
} else if (valid_df(env$data)) {
|
||||
# an element `data` will be in the environment when using older dplyr versions, or some tidymodels functions such as `fit()`
|
||||
return(env$data)
|
||||
|
||||
Reference in New Issue
Block a user