varSpec: Get variable specification for a Cubist/C5 object

Description Usage Arguments Value Author(s) Examples

View source: R/varSpec.R

Description

Obtain variable names, type (numeric, ordered, factor) and levels as a tibble

Usage

1
varSpec(object)

Arguments

object

Cubist/C5 object

Value

A tibble with three columns: variable(character), type(character) and levels(a list-column). For numeric variables, levels are set to NA.

Author(s)

Srikanth KS, sri.teach@gmail.com

Examples

1
2
3
4
5
6
7
data("attrition", package = "modeldata")
attrition <- tibble::as_tibble(attrition)
cols_att <- setdiff(colnames(attrition), c("MonthlyIncome", "Attrition"))

cb_att <-
  Cubist::cubist(x = attrition[, cols_att],y = attrition[["MonthlyIncome"]])
varSpec(cb_att)

tidyrules documentation built on July 1, 2020, 5:49 p.m.