FIND DATA: By Journal | Sites   ANALYZE DATA: Help with R | SPSS | Stata | Excel   WHAT'S NEW? US Politics | IR | Law & Courts🎵
   FIND DATA: By Journal | Sites   WHAT'S NEW? US Politics | IR | Law & Courts🎵
WHAT'S NEW? US Politics | IR | Law & Courts🎵

Run R Code Example Online

library(poliscidata)

# Collapsing numeric variables into roughly equal-sized groups (quantiles)
describe(world$pop_urban)
world$pop_urban.5cat = cut2(world$pop_urban, g=5)

# the next two lines not strictly necessary but should check our work
levels(world$pop_urban.5cat)
freq(world$pop_urban.5cat, plot=F)