createBins: Add binned variables to data

Description Usage Arguments Value Examples

View source: R/logiBin.R

Description

This function creates a data frame with binned variables

Usage

1
createBins(binObj, df, xVars, prefix = "b_")

Arguments

binObj

- An object returned by getBins or any other function in this package

df

- A data frame

xVars

- A vector of names of variables for which bins have to be created

prefix

- The prefix to be added to the variable name to create the new variable. Default value is b_

Value

Returns a dataframe which adds the binned variables to the original data frame

Examples

1
2
b1 <- getBins(loanData, "bad_flag", c('age', 'score', 'balance'), minCr=0.8)
loanData <- createBins(b1, loanData, c('age', 'balance'))

logiBin documentation built on May 2, 2019, 2:01 p.m.