+ "markdown": "---\ntitle: \"Posit::Conf 2023 | TidyTuesday\"\nauthor: \"Mitch Harrison\"\ncategories:\n - \"Data Viz\"\n - \"TidyTuesday\"\ndate: \"January 14, 2025\"\nimage: \"../../images/thumbnails/projects/tidytuesday/01142025.png\"\nexecute: \n warning: false\n message: false\n---\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(tidyverse)\nlibrary(lubridate)\nlibrary(ggthemes)\n\nconf23 <- read_csv(\"data/conf2023.csv\")\nconf24 <- read_csv(\"data/conf2024.csv\")\n\n#conf23 <- read_csv(\"projects/tidytuesday_01142025/data/conf2023.csv\")\n#conf24 <- read_csv(\"projects/tidytuesday_01142025/data/conf2024.csv\")\n```\n:::\n\n\n\n\n\n# The Viz\n\nHello all! This week's \n[TidyTuesday](https://github.com/rfordatascience/tidytuesday/blob/main/data/2025/2025-01-14/readme.md)\nbrings us the event schedule from the posit::conf events of 2023 and 2024.\nAlthough there isn't always much in the way of data analysis that we can do with\na simple list of conference events, I did find a phenomenon that amused me.\n\nAt the conference, there are three types of talks: keynote talks to open and\nclose both days of the conference, regular talks that occur during the day, and\nvery quick lightning talks that cover smaller topics in a very short time\nwindow. For some reason, all of the lightning talks were scheduled to overlap\nwith the only pharma-related main talks at the entire event. So people had to\nchoose whether to attend the pharma talks or the lightning talks. I'm not sure\nwhat the rationale for scheduling it that was is, but here's a plot to\ndemonstrate!\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\nset.seed(103)\n\nnew_23 <- conf23 |>\n distinct(session_type, session_start, .keep_all = TRUE) |>\n mutate(\n session_start_time = format(session_start, \"%H:%M:%S\"),\n session_start_time = as.POSIXct(session_start_time, format = \"%H:%M:%S\"),\n session_end_time = session_start_time + minutes(session_length),\n date_encoded = if_else(session_date == min(session_date), 1, 2),\n session_date2 = if_else(session_date == as.POSIXct(\"2023-09-19\"), 0, 1)\n )\n\nlightning <- new_23 |>\n filter(session_type == \"lightning\")\n\nnon_lightning <- new_23 |>\n filter(session_type != \"lightning\")\n\nnew_23 |>\n ggplot(aes(color = session_type, x = session_start_time, y = session_date2)) + \n geom_jitter(data = lightning, size = 2, height = 0.1, width = 0) +\n geom_point(data = non_lightning, size = 3) +\n geom_segment(\n aes(xend = session_end_time),\n data = non_lightning,\n linewidth = 1.5\n ) +\n geom_rect(\n xmin = as.POSIXct(\"17:00:00\", format = \"%H:%M:%S\"),\n xmax = as.POSIXct(\"19:20:00\", format = \"%H:%M:%S\"),\n ymin = 0.33,\n ymax = 0.67,\n fill = \"#f0f0f0\", # theme background color\n color = NA\n ) +\n annotate(\n geom = \"text\",\n x = as.POSIXct(\"17:00:00\", format = \"%H:%M:%S\"),\n y = 0.5,\n label = paste(\n \"Lightning talks took place\\nexclusively during these\\nPharma-related\",\n \"main talks.\\nSorry, doc!\"\n ),\n hjust = \"left\",\n color = \"#016392\",\n fontface = \"bold\"\n ) +\n annotate(\n geom = \"segment\",\n x = as.POSIXct(\"16:20:00\", format = \"%H:%M:%S\"),\n xend = as.POSIXct(\"16:55:00\", format = \"%H:%M:%S\"),\n y = 0.14,\n yend = 0.34,\n color = \"#016392\",\n linewidth = 1\n ) +\n theme_fivethirtyeight() +\n scale_color_wsj() +\n scale_y_continuous(\n breaks = c(0, 1),\n labels = c(\"Sep 19\", \"Sep 20\")\n ) +\n labs(\n title = \"Event schedule - posit::conf(2023)\",\n subtitle = \"Hopefully there were no impatient pharmacists there.\",\n color = element_blank()\n )\n```\n\n::: {.cell-output-display}\n{width=672}\n:::\n:::\n\n\n\n\n\n# Challenges\n\nAlthough the plot is pretty simple, I used some non-intuitive techniques to\nplace the text and line annotations when the data are dates instead of regular\ncontinuous values. I encoded the `y` axis as a continuous one and used\n`POSIXct` objects to place them on the `x` axis. Feel free to check the code to\nsee how that worked!\n\n# Conclusion\n\nAs always, thanks for reading! Feel free to reach out to me on\n[LinkedIn](https://linkedin.com/in/harrisonme) if you want to connect or ask\nquestions about my work. See you next week!",
0 commit comments