Learn R Programming

intubate (version 1.0.0)

leaps: Interfaces for leaps package for data science pipelines.

Description

Interfaces to leaps functions that can be used in a pipeline implemented by magrittr.

Usage

ntbt_regsubsets(data, ...)

Arguments

data
data frame, tibble, list, ...
...
Other arguments passed to the corresponding interfaced function.

Value

Object returned by interfaced function.

Details

Interfaces call their corresponding interfaced function.

See Also

regsubsets

Examples

Run this code
## Not run: 
# library(intubate)
# library(magrittr)
# library(leaps)
# 
# ## Original function to interface
# fit <- regsubsets(Fertility ~ ., data = swiss, nbest = 2)
# summary(fit)
# 
# ## The interface reverses the order of data and formula
# fit <- ntbt_regsubsets(data = swiss, Fertility ~ ., nbest = 2)
# summary(fit)
# 
# ## so it can be used easily in a pipeline.
# swiss %>%
#   ntbt_regsubsets(Fertility ~ ., nbest = 2) %>%
#   summary()
# ## End(Not run)

Run the code above in your browser using DataLab