Learn R Programming

orbital (version 0.4.1)

augment.orbital_class: Augment using orbital objects

Description

augment() will add column(s) for predictions to the given data.

Usage

# S3 method for orbital_class
augment(x, new_data, ...)

Value

A modified data frame or remote database table.

Arguments

x

An orbital object.

new_data

A data frame or remote database table.

...

Not currently used.

Details

This function is a shorthand for the following code

dplyr::bind_cols(
  predict(orbital_obj, new_data),
  new_data
)

Note that augment() works better and safer than above as it also works on data set in data bases.

This function is confirmed to not work work in spark data bases or arrow tables.

Examples

Run this code
if (FALSE) { # rlang::is_installed(c("recipes", "tidypredict", "workflows"))
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)

augment(orbital_obj, mtcars)
}

Run the code above in your browser using DataLab