Creating Basic Charts with ggplot2
Code Example 3
Code
9 / 11
Code Example 3
Code
Code Example 3
r
prepared_data |>
ggplot(aes(x = age_years_derived)) +
geom_histogram(binwidth = 5, boundary = 0, color = "white") +
labs(
title = "Age Distribution at Enrollment",
x = "Age, years",
y = "Number of participants"
)