orbital_inline {orbital} | R Documentation |
Convert orbital objects to quosures
Description
Use orbital object splicing function to apply orbital prediction in a quosure
aware function such as dplyr::mutate()
.
Usage
orbital_inline(x)
Arguments
x |
An orbital object. |
Details
This function is mostly going to be used for
Dots Injection.
This function is used internally in predict(), but
is also exported for user flexibility. Should be used with !!!
as seen in
the examples.
Note should be taken that using this function modifies existing variables and creates new variables, unlike predict() which only returns predictions.
Value
a list of quosures.
Examples
library(workflows)
library(recipes)
library(parsnip)
rec_spec <- recipe(mpg ~ ., data = mtcars) %>%
step_normalize(all_numeric_predictors())
lm_spec <- linear_reg()
wf_spec <- workflow(rec_spec, lm_spec)
wf_fit <- fit(wf_spec, mtcars)
orbital_obj <- orbital(wf_fit)
orbital_inline(orbital_obj)
library(dplyr)
mtcars %>%
mutate(!!!orbital_inline(orbital_obj))
[Package orbital version 0.2.0 Index]