Golem Grad Tortoises

animals
Published

March 3, 2026

Hermann’s tortoise health by sex and locality.

Load Packages

require(pacman)
p_load(tidytuesdayR, tidyverse, janitor, here, trashpanda, ggside, magick)

Load Data

tuesdata <- tidytuesdayR::tt_load('2026-03-03')
clutch_size_cleaned <- tuesdata$clutch_size_cleaned
tortoise_body_condition_cleaned <- tuesdata$tortoise_body_condition_cleaned

Plot

plot <- tortoise_body_condition_cleaned |> 
  mutate(sex = case_when(sex == "f" ~ "Female",
                         sex == "m" ~ "Male",
                         .default = sex)) |> 
  mutate(locality = case_when(locality == "Konjsko" ~ "Konjsko (Mainland)",
                         .default = locality)) |> 
  ggplot(aes(
    x = straight_carapace_length_mm, 
    y = body_condition_index, 
    fill = locality)) +
  stat_ellipse(
    geom = "polygon", 
    alpha = 0.3, 
    colour = "black",
    linewidth = 0.5) +
  facet_wrap(~sex) +
  scale_fill_viridis_d("Locality") +
  labs(x = "Straight Carapace Length (mm)",
       y = "Body Condition Index",
       title = "Female Golem Grad tortoises are healthier on the mainland",
       subtitle = str_wrap("In this dense island population, male Hermann’s tortoises vastly outnumber and harass females, causing injury, reduced reproduction, and lower survival, with long-term data predicting the last female will disappear by 2083. It appears this effect is greater on the Beach and Plateau compared to the mainland.")) +
  theme_cole(remove_grid = TRUE, base_size = 15) +
  theme(axis.line = element_line(colour = "black"),
        strip.text = element_text(size = 20),
        plot.title = element_text(hjust = 0),
        plot.subtitle = element_text(hjust = 0),
        panel.border = element_rect(colour = "black", fill = NA)) +
  add_caption_cwb() 

# Save and display images
current_dir <- dirname(knitr::current_input())
plot_name <- "golem_grad_tortoises.png"

ggsave(plot = plot, 
       dpi = "screen",
       width = 20,
       height = 15,
       device = ragg::agg_png,
       filename = file.path(current_dir, plot_name))


# Read the big plot
img <- image_read(file.path(current_dir, plot_name))

# Force 16:9 aspect ratio with minimal padding
# Target size: 1200x675 px (16:9)
img_card <- image_scale(img, "1200x675")           # scale to fit inside 16:9
img_card <- image_extent(
  img_card,
  geometry = "1200x675",
  gravity = "center"
)

# Save as card preview
image_write(img_card, path = file.path(current_dir, "preview.png"))

knitr::include_graphics(
  file.path(current_dir, plot_name)
)

References

cite_packages(format = "rmd")
  1. Ooms J (2025). magick: Advanced Graphics and Image-Processing in R. doi:10.32614/CRAN.package.magick https://doi.org/10.32614/CRAN.package.magick, R package version 2.9.0, https://CRAN.R-project.org/package=magick.

  2. Landis J (2025). ggside: Side Grammar Graphics. doi:10.32614/CRAN.package.ggside https://doi.org/10.32614/CRAN.package.ggside, R package version 0.4.1, https://CRAN.R-project.org/package=ggside.

  3. Baril C (????). trashpanda: Cole’s Personal Collection of R Functions, Themes, and Palettes. R package version 0.0.1, https://colebaril.github.io/trashpanda/.

  4. Müller K (2025). here: A Simpler Way to Find Your Files. doi:10.32614/CRAN.package.here https://doi.org/10.32614/CRAN.package.here, R package version 1.0.2, https://CRAN.R-project.org/package=here.

  5. Firke S (2024). janitor: Simple Tools for Examining and Cleaning Dirty Data. doi:10.32614/CRAN.package.janitor https://doi.org/10.32614/CRAN.package.janitor, R package version 2.2.1, https://CRAN.R-project.org/package=janitor.

  6. Grolemund G, Wickham H (2011). “Dates and Times Made Easy with lubridate.” Journal of Statistical Software, 40(3), 1-25. https://www.jstatsoft.org/v40/i03/.

  7. Wickham H (2025). forcats: Tools for Working with Categorical Variables (Factors). doi:10.32614/CRAN.package.forcats https://doi.org/10.32614/CRAN.package.forcats, R package version 1.0.1, https://CRAN.R-project.org/package=forcats.

  8. Wickham H (2025). stringr: Simple, Consistent Wrappers for Common String Operations. doi:10.32614/CRAN.package.stringr https://doi.org/10.32614/CRAN.package.stringr, R package version 1.6.0, https://CRAN.R-project.org/package=stringr.

  9. Wickham H, François R, Henry L, Müller K, Vaughan D (2023). dplyr: A Grammar of Data Manipulation. doi:10.32614/CRAN.package.dplyr https://doi.org/10.32614/CRAN.package.dplyr, R package version 1.1.4, https://CRAN.R-project.org/package=dplyr.

  10. Wickham H, Henry L (2026). purrr: Functional Programming Tools. doi:10.32614/CRAN.package.purrr https://doi.org/10.32614/CRAN.package.purrr, R package version 1.2.1, https://CRAN.R-project.org/package=purrr.

  11. Wickham H, Hester J, Bryan J (2025). readr: Read Rectangular Text Data. doi:10.32614/CRAN.package.readr https://doi.org/10.32614/CRAN.package.readr, R package version 2.1.6, https://CRAN.R-project.org/package=readr.

  12. Wickham H, Vaughan D, Girlich M (2025). tidyr: Tidy Messy Data. doi:10.32614/CRAN.package.tidyr https://doi.org/10.32614/CRAN.package.tidyr, R package version 1.3.2, https://CRAN.R-project.org/package=tidyr.

  13. Müller K, Wickham H (2026). tibble: Simple Data Frames. doi:10.32614/CRAN.package.tibble https://doi.org/10.32614/CRAN.package.tibble, R package version 3.3.1, https://CRAN.R-project.org/package=tibble.

  14. Wickham H (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. ISBN 978-3-319-24277-4, https://ggplot2.tidyverse.org.

  15. Wickham H, Averick M, Bryan J, Chang W, McGowan LD, François R, Grolemund G, Hayes A, Henry L, Hester J, Kuhn M, Pedersen TL, Miller E, Bache SM, Müller K, Ooms J, Robinson D, Seidel DP, Spinu V, Takahashi K, Vaughan D, Wilke C, Woo K, Yutani H (2019). “Welcome to the tidyverse.” Journal of Open Source Software, 4(43), 1686. doi:10.21105/joss.01686 https://doi.org/10.21105/joss.01686.

  16. Harmon J, Hughes E (2025). tidytuesdayR: Access the Weekly ‘TidyTuesday’ Project Dataset. doi:10.32614/CRAN.package.tidytuesdayR https://doi.org/10.32614/CRAN.package.tidytuesdayR, R package version 1.2.1, https://CRAN.R-project.org/package=tidytuesdayR.

  17. Rinker TW, Kurkiewicz D (2018). pacman: Package Management for R. version 0.5.0, http://github.com/trinker/pacman.