# NOT RUN {
# Load German credit data and create a subset
data(germancredit)
df <- germancredit[, c('creditability', 'credit.amount', 'duration.in.month',
'savings.account.and.bonds', 'purpose')]
# Bin all variables of the data frame (apart from the target variable)
# with default parameter settings
binning <- woe.binning(df, 'creditability', df)
# Tabulate the binned variables
tabulate.binning <- woe.binning.table(binning)
tabulate.binning
# }
# NOT RUN {
# Plot a layouted table (using the gridExtra library) for a specific
# variable (in this example for the first binned variable
# with the highest IV value)
library(gridExtra)
grid.table(tabulate.binning[[1]],
theme = ttheme_default(core=list(bg_params=
list(fill=c(rep(c('grey95','grey90'),
length.out=nrow(tabulate.binning[[1]])-1),
'#BCC7BD')),fg_params=list(cex=0.8)),
colhead=list(fg_params=list(cex=0.8))),
rows=NULL)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab