powered by
This function creates a data frame with binned variables
createBins(binObj, df, xVars, prefix = "b_")
- An object returned by getBins or any other function in this package
- A data frame
- A vector of names of variables for which bins have to be created
- The prefix to be added to the variable name to create the new variable. Default value is b_
Returns a dataframe which adds the binned variables to the original data frame
# NOT RUN { b1 <- getBins(loanData, "bad_flag", c('age', 'score', 'balance'), minCr=0.8) loanData <- createBins(b1, loanData, c('age', 'balance')) # }
Run the code above in your browser using DataLab