hayio
6/7/2015 - 12:54 PM

Divide explicitly values into buckets of ranges. Something like discretizing.

Divide explicitly values into buckets of ranges. Something like discretizing.

TODO delete this and add discretize usage function

df %>% mutate(days_up=ifelse(between(days_up, 0, 180), '<180',
                        ifelse(between(days_up, 181, 900), '180 do 900',
                               ifelse(between(days_up, 901, 1000000), '>900', '0'))))