YouTip LogoYouTip

R Func Cut

# R cut() Function - Numeric Binning [![Image 3: R Language Examples](https://example.com/images/up.gif) R Language Examples](https://example.com/r/r-examples.html) The R cut() function is used to divide continuous numeric values into discrete intervals (binning). Binning is an important step in data preprocessing, commonly used for creating grouped statistics and histograms. The cut() function syntax is as follows: cut(x, breaks, labels = NULL, right = TRUE) **Parameter Description:** * **x** Input numeric vector. * **breaks** Breakpoint vector, or the number of intervals desired. * **labels** Custom interval labels, default uses the interval range. * **right** Whether the interval is right-closed, default TRUE (left-open, right-closed). ## Example # Student Scores scores <-c(45, 55, 62, 78,
← R Func DiffR Func Cov β†’