CLiREN-LMS
Data Visualization and Dashboards

Creating Basic Charts with ggplot2

Code Example 4

30-45 minutes Applied Step 10 of 11
Code

Code Example 4

10 / 11
Code

Code Example 4

r

prepared_data |>
  ggplot(aes(x = site, y = age_years_derived)) +
  geom_boxplot() +
  coord_flip() +
  labs(
    title = "Age Distribution by Site",
    x = "Site",
    y = "Age, years"
  )