R/merge_bins.R

merge_bins <- function(replace, df){
  # df contains two rows from woe that need to be merged.
  # replace has the replacement row info
  # Output will be a single row
  data.frame(
    rank = replace$rank,
    bad = sum(df$bad),
    total = sum(df$total),
    bad_percent = replace$bad_percent,
    good_percent = replace$good_percent,
    percent = sum(df$percent),
    woe = replace$woe,
    IV = replace$IV
    ) %>%
    return
}
kraken19/woeR documentation built on May 29, 2019, 3:39 a.m.