Astronaut Mission Trends and Career Paths: A Journey from Nationality to Occupation
An exploration of astronaut missions over time, highlighting key periods of activity across different nationalities, and the flow of astronauts through various career stages from nationality, mission type, gender, to occupation.
#SWDchallenge
Author
Steven Ponce
Published
October 2, 2024
Steps to Create this Graphic
1. Load Packages & Setup
Code
pacman::p_load( tidyverse, # Easily Install and Load the 'Tidyverse' ggtext, # Improved Text Rendering Support for 'ggplot2' showtext, # Using Fonts More Easily in R Graphs janitor, # Simple Tools for Examining and Cleaning Dirty Data skimr, # Compact and Flexible Summaries of Data scales, # Scale Functions for Visualization lubridate, # Make Dealing with Dates a Little Easier glue, # Interpreted String Literals ggalluvial, # Alluvial Plots in 'ggplot2' patchwork, # The Composer of Plots gghighlight # Highlight Lines and Points in 'ggplot2')### |- figure size ---- camcorder::gg_record( dir = here::here("temp_plots"), device ="png",width =12,height =8,units ="in",dpi =320)### |- resolution ---- showtext_opts(dpi =320, regular.wt =300, bold.wt =800)
### |- plot image ---- library(ggplotify)# Convert patchwork plot to grob # There was some issues between patchwork and ggsaveplot_grob <-as.grob(combined_plot)# Save the plot againggsave(filename = here::here("data_visualizations/SWD Challenge/2024/swd_2024_10.png"),plot = plot_grob,width =12,height =8,units ="in",dpi =320)### |- plot thumbnail---- magick::image_read(here::here("data_visualizations/SWD Challenge/2024/swd_2024_10.png")) |> magick::image_resize(geometry ="400") |> magick::image_write(here::here("data_visualizations/SWD Challenge/2024/thumbnails/swd_2024_10.png"))
8. Session Info
Code
info <-capture.output(sessioninfo::session_info())# Remove lines that contain "[1]" and "[2]" (the file paths)filtered_info <-grep("\\[1\\]|\\[2\\]", info, value =TRUE, invert =TRUE)cat(filtered_info, sep ="\n")
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 4.4.1 (2024-06-14 ucrt)
os Windows 10 x64 (build 19045)
system x86_64, mingw32
ui RTerm
language (EN)
collate English_United States.utf8
ctype English_United States.utf8
tz America/New_York
date 2024-10-02
pandoc 3.2 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
─ Packages ───────────────────────────────────────────────────────────────────
! package * version date (UTC) lib source
P cli 3.6.3 2024-06-21 [?] RSPM (R 4.4.0)
P digest 0.6.37 2024-08-19 [?] RSPM (R 4.4.0)
P evaluate 0.24.0 2024-06-10 [?] RSPM (R 4.4.0)
P fastmap 1.2.0 2024-05-15 [?] RSPM (R 4.4.0)
P htmltools 0.5.8.1 2024-04-04 [?] RSPM (R 4.4.0)
P htmlwidgets 1.6.4 2023-12-06 [?] CRAN (R 4.4.0)
P jsonlite 1.8.8 2023-12-04 [?] RSPM (R 4.4.0)
P knitr 1.48 2024-07-07 [?] RSPM (R 4.4.0)
P rlang 1.1.4 2024-06-04 [?] RSPM (R 4.4.0)
P rmarkdown 2.28 2024-08-17 [?] RSPM (R 4.4.0)
P sessioninfo 1.2.2 2021-12-06 [?] RSPM (R 4.4.0)
P xfun 0.47 2024-08-17 [?] RSPM (R 4.4.0)
P yaml 2.3.10 2024-07-26 [?] RSPM (R 4.4.0)
P ── Loaded and on-disk path mismatch.
──────────────────────────────────────────────────────────────────────────────