R: Converts an R model object into a table

parse_model {tidypredict} | R Documentation

## Converts an R model object into a table

### Description

It parses a fitted R model's structure and extracts the components needed to create a dplyr formula for prediction. The function also creates a data frame using an specific format so that other functions in the future can also pass parsed tables to a given formula creating function.

### Usage

    parse_model(model)

### Arguments

`model` | An R model object. It currently supports lm(), glm() and randomForest() models.

### Examples

    library(dplyr)
    df <- mutate(mtcars, cyl = paste0("cyl", cyl))
    model <- lm(mpg ~ wt + cyl * disp, offset = am, data = df)
    parse_model(model)

[Package tidypredict version 0.1.0 Index]