createBins {logiBin} | R Documentation |
Add binned variables to data
Description
This function creates a data frame with binned variables
Usage
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
b1 <- getBins(loanData, "bad_flag", c('age', 'score', 'balance'), minCr=0.8)
loanData <- createBins(b1, loanData, c('age', 'balance'))
[Package logiBin version 0.3 Index]