augment.orbital_class {orbital}R Documentation

Augment using orbital objects

Description

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

Usage

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

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.

Value

A modified data frame or remote database table.

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)

augment(orbital_obj, mtcars)


[Package orbital version 0.3.0 Index]