Learn R Programming

formulize (version 0.1.0)

formulize: Create a formula/recipe interface to a modelling method

Description

Create a formula/recipe interface to a modelling method

Usage

formulize(f)

Arguments

f

A function with a matrix/vector interface. Assumes data is passed to this function via some combination of arguments x, X, y, Y

Value

The same function, wrapped to have formula/dataframe and recipe/dataframe interfaces.

Examples

Run this code
# NOT RUN {
library(glmnet)

glmnet_form <- formulize(cv.glmnet)

model <- glmnet_form(mpg ~ drat * hp - 1, mtcars)
predict(model, head(mtcars))

# }

Run the code above in your browser using DataLab