moderndive / ModernDive_book

Statistical Inference via Data Science: A ModernDive into R and the Tidyverse

Home Page:https://www.moderndive.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction of cut( ) function in C.1.5 Converting a numerical variable to categorical one

xiaochi-liu opened this issue · comments

In the current C.1.5 "Converting a numerical variable to categorical one", when introducing other options with the cut function, it is said:

"You could also have RStudio equally divide the variable into a balanced number of groups. For example, specifying breaks = 3 would create 4 groups with approximately the same number of values in each group."

I think setting breaks = 3 in the cut function would give you 3 equal intervals, and the number of values in each interval may be varied.