Skip to content
Justice Tech School

Histograms and Boxplots

hist shows a distribution and boxplot compares groups.

Example
set.seed(1)
x <- rnorm(200)
hist(x, breaks = 20, main = "Histogram", col = "grey")
boxplot(x ~ rep(c("a", "b"), 100), main = "By group")

Exercise

Distribution.

(x)

Quiz Test

What does breaks change?

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