toSql | R Documentation |
Generates a user-defined SQL function from a fitted linear model which can then be used for prediction.
toSql( model, fn_title, numeric_type = "NUMERIC(24, 6)", return_type = "NUMERIC(10,6)", ... ) ## S4 method for signature 'lm' toSql(model, fn_title, numeric_type, return_type)
model |
Model to create SQL function from |
fn_title |
Name of function to create. Should generally include the schema |
numeric_type |
SQL type to use for numeric parameters. This is also used in the coefficient definitions |
return_type |
SQL type of return value |
... |
Additional arguments |
Response
fitted_model <- lm(mpg ~ cyl + wt, data=mtcars) toSql(fitted_model, "dbo.PredictModel")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.