Skip to content
Justice Tech School

Binning with cut

cut puts numbers into labelled intervals.

Example
s <- c(55, 72, 88, 95)
g <- cut(s, breaks = c(0, 60, 80, 100), labels = c("C", "B", "A"))
print(g)
print(table(g))

Exercise

Intervals.

(s, breaks = b)

Quiz Test

What does cut return?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.