Learn R Programming

orbital (version 0.4.1)

orbital_sql: Convert to SQL code

Description

Returns SQL code that is equivilant to prediction code.

Usage

orbital_sql(x, con)

Value

SQL code.

Arguments

x

An orbital object.

con

A connection object.

Details

This function requires a database connection object, as the resulting code SQL code can differ depending on the type of database.

Examples

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

library(dbplyr)
con <- simulate_dbi()

orbital_sql(orbital_obj, con)
}

Run the code above in your browser using DataLab