TidyTuesday Assignment

Author

Colvette Brown

Published

July 24, 2025

#| label: load-libraries-data
#| warning: false
#| message: false
#| warning: true

library(tidyverse)    # For ggplot, dplyr, and friends
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.2     ✔ tibble    3.3.0
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.0.4     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library (ggridges) # For the ridgeline plot
library (ggrepel) # For clean annotations
library(plotly)
Warning: package 'plotly' was built under R version 4.5.1

Attaching package: 'plotly'

The following object is masked from 'package:ggplot2':

    last_plot

The following object is masked from 'package:stats':

    filter

The following object is masked from 'package:graphics':

    layout

Load tIidyTuesday MTA data

MTA_raw <- read_csv("data/MTA_Permanent_Art_Catalog__Beginning_1980_20250724.csv")
Rows: 381 Columns: 9
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (8): Agency, Station Name, Line, Artist, Art Title, Art Material, Art De...
dbl (1): Art Date

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
MTAart_filtered <- MTA_raw |>
  filter(`Art Date` >= 2013 & `Art Date` <= 2023)

Plotting a bar chart to visualize the number of artwork by year over a 10-year period

Art_display <- ggplot(MTAart_filtered, aes(x = `Art Date`, fill = Agency)) +
  geom_bar(position = "dodge") +
  labs(title = "Artwork display per year by agency (2013-2023)",
       x = "Year",
       y = "Count", caption= "Source: MTA Permanent Art Catalog (Beginning 1980) — https://www.mta.info/open-data.\nAfter 2020, there’s a noticeable decline across all agencies, possibly reflecting disruptions due to the COVID-19 pandemic.") +
  theme_minimal()

Art_display + theme(panel.grid.major = element_line(linetype = "blank"),
    panel.grid.minor = element_line(linetype = "blank"),
    axis.text = element_text(size = 10),
    plot.title = element_text(family = "serif"),
    plot.background = element_rect(linetype = "solid"))

Public_art <- ggplot(MTAart_filtered, aes(x= `Art Date`, y= Agency, fill =Agency))+
    geom_density_ridges(alpha = 0.7, scale = 2, rel_min_height = 0.01) +
  labs(
    title = "MTA Public Art Displays by Agency (2013–2023)",
    x = "Year",
    y = "MTA Agency", caption= "Source: MTA Permanent Art Catalog (Beginning 1980) — https://www.mta.info/open-data.\nThis plot illustrates the distribution of public art displays across MTA agencies from 2013 to 2023. Peaks in 2017–2019 reflect a period of high art display activity, while the noticeable decline after 2020 likely reflects pandemic-related disruptions.") +
  theme_minimal()

ggplotly(Public_art + theme(panel.grid.major = element_line(linetype = "blank"),
    panel.grid.minor = element_line(linetype = "blank"),
    plot.title = element_text(face = "bold"),
    legend.position = "none") + theme(plot.subtitle = element_text(hjust = 1),
    panel.grid.major = element_line(linetype = "blank"),
    panel.grid.minor = element_line(linetype = "blank"),
    legend.position = "none"))
Picking joint bandwidth of 1.17