Introduction :

This project evaluates collected data done by the MDOT and jurisdictions in sixteen of the twenty-four counties of Maryland. The data collected illustrates if reinvestment infrastructure or emergency blockades affect the economic growth of the state of Maryland.

Data source – Maryland open portal data. Maryland _ Road _ Closure_ 20260613.csv

Variables defined :
Categorical and quantitative variables:

Qualittative variables County: Montgomery, Prince George county, Baltimore county, and etc.

Direction: North, East, South, and West.

Lanes: right lanes, middle lanes, and left lanes.

Incident: construction or car crash Location: specific county.
Date / updates : What time did the road closure occur and reopen.

Quantitative variables:

Lat: latitude coordinates of road closure.

Long : longitude coordinates of road closure.

Data cleaning:

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.2.1     ✔ readr     2.2.0
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.3     ✔ tibble    3.3.1
## ✔ lubridate 1.9.5     ✔ tidyr     1.3.2
## ✔ purrr     1.2.2     
## ── 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(dplyr)
road_data <- read_csv("Maryland_Road_Closures_20260613.csv")
## Rows: 46 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (7): county, incident, direction, lanes, created, updated, location
## dbl (2): lat, long
## 
## ℹ 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.
county_summary <- road_data %>% 
  count(county, name = "total_closure") %>% 
  mutate(Region = case_when(
    county %in% c("Baltimore", "Baltimore City", "Anne Arundel", "Howard", "Harford", "Carroll") ~ "Economic Center of Maryland",
    county %in% c("Montgomery", "Frederick", "Prince George" ) ~ "Dc connectors",
    county %in% c("Garret", "Allegany", "Washington") ~ "Industrial materials of Maryland",
    TRUE ~ "Low state economic impact"
  ))

The functions used to clean data are that of mutate() function abd the case_when() function.

The mutate() function is a dplyr function that is typically used to create new columns or to tamoer with existing ones.

How was it used in this script? This function was used to command R to create a column named regions for my script. The case_when() function is a data cleaning function that is used tosort out data. This simialr to an if else statement.
How was it used in this script ? It was used to categories counties into three specific economic groups, “low state economic impact”, “ “industrial materials of Maryland”, “Economic center of Maryland”. For example, Baltimore county, “Anne Arundel”, and “Howard” county are sorted into the ecnomic centers of Maryland.

Data visualization 1

# Process the data to calculate total closures per county and assign economic regions
# library(tidyverse) Loads tidyverse packages from the tidyverse download
# read_csv uploads csv file into r script and reads through the whole file
# %>% passes the result of one function directly into the next arguement
# count() groups data by the county
# total_closure 
# mutate() creates new column and updates existing ones 
# case_when() evaluates conditions to assign into the region column
# %in% it will check for matching data
library(tidyverse)
road_data <- read_csv("Maryland_Road_Closures_20260613.csv")
## Rows: 46 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (7): county, incident, direction, lanes, created, updated, location
## dbl (2): lat, long
## 
## ℹ 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.
county_summary <- road_data %>%
  count(county, name = "total_closure") %>%
  mutate(Region = case_when(
    county %in% c("Baltimore", "Baltimore City", "Anne Arundel", "Howard", "Harford", "Carroll") ~ "Economic Center of Maryland",
    county %in% c("Montgomery", "Frederick", "Prince George" ) ~ "Dc connectors",
    county %in% c("Garret", "Allegany", "Washington") ~ "Industrial materials of Maryland",
    TRUE ~ "Low state economic impact"
  ))
# ggplot() creates a new graph and prepares for county_summary
# aes() short for aesthetics 
# x = reorder() commands what goes on the x-axis
# y = total_closure maps the length of the bar
# fill = region colors the bars depending their economic impact 
ggplot(county_summary, aes(x = reorder(county, total_closure), y = total_closure, fill = Region)) +
  geom_col() +
  coord_flip() + 
  labs(
    title = "Closure frequency by county",
    subtitle = "Evaluating potential commercial distripution risk across Maryland economic region",
    x = "County Jurisdiction",
    y = "Number of Incidents)",
    caption = "Source: Maryland MDOC state operations center",
    fill = "Maryland Region "
  ) +
  scale_fill_brewer(palette = "Set2" ) +
  theme_minimal()

Data visualization 2

# Plots the distribution of incident types to see if closures are planned or emergency
# Data visualization 2
# library(tidyverse) Loads tidyverse packages from the tidyverse download
# ggplot() creates and prepares a new graph
# geom_bar() tells R on how to draw and apply data for visual purposes
# labs() means labels this adds title, subtilte, 
# x = "incident Category' this tells r that x will be named "Incidents category"
# y = "NUmber of Occurrencies" this tells r that y will be named "Number of occurencies
# "caption =" this cites data source
# scale_fill_brewer controls the color pallette when using categorical variables 
# theme_minimal() changes the overall background design of plot 
ggplot(road_data, aes(x = incident, fill = incident)) +
  geom_bar() +
  labs(
    title = "Types of Road Closure Incidents",
    subtitle = "Comparing planned construction frequencies against emergency traffic blockades",
    x = "Incident Category",
    y = "Number of Occurrences",
    caption = "Source: Maryland MDOC state operations center"
  ) +
  scale_fill_brewer(palette = "Pastel1") +
  theme_minimal()
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Pastel1 is 9
## Returning the palette you asked for with that many colors

Conclusion:

While this bar chart does not directly measure economic metrics like GDP, revenue loss, or economic strain, it highlights highly coordinated routes of transportation on Maryland highways that are key to economic trade. When directly analyzing the graph, there is a high degree of state-operated road operations in high economic centers in Maryland, specifically Baltimore County.

Financially, these road closures cause economic strain for many Maryland businesses and trades. While road closures occur, cargo vehicles coming from northern and western Maryland are forced to halt and delay goods entering the metropolitan areas of Maryland. This not only strains micro-economies of goods for small businesses but also, on a macroeconomic scale, for larger businesses such as Walmart.

Future data research:

What I personally would have liked to include is the direct measurement of financial loss or delivery delay time. Although my charts depict which counties face the highest frequency of road closure, it does not financially depict the exact average or total money lost from road closure. Additionally, I believe that partnering the financial data graph with a time delay graph would have shed more light on this concern.