Exercise 11 — PMAP 8551, Summer 2025

Author

Colvette Brown

Published

July 14, 2025

library(tidyverse)
library(plotly)

interactivity <- read_csv ("data/unemployment.csv") 
interactivity_clean <- interactivity %>% 
  filter(year== 2010) %>% 
  group_by(region, state, na.rm = TRUE) %>% 
  summarize(total_unemployment = sum(unemployment)*100,1) %>% 
  ungroup() %>%
  mutate(
    percent_unemployment = round((total_unemployment / sum(total_unemployment)) * 100, 1)
  )
{r}
static_plot <- ggplot(interactivity_clean, aes(x= percent_unemployment, y=region, color=state)) +
  geom_point()+
 theme_minimal()+
theme(legend.position = "NONE")+
labs(title = "Regional unemployment in 2010", x= "Unemploymet (%)", y= "Region")

static_plot

{r}
ggplot(interactivity, aes(x= year, y=unemployment, color=region)) +
  geom_point()+
  geom_smooth()+
 theme_minimal()+
theme(legend.position = "NONE")+
labs(title = "Regional unemployment between 2006 and 2016", x= "Unemploymet (%)", y= "Region")

New_Card <- ggplot(interactivity_clean, aes(x=total_unemployment, color= state))+
  geom_histogram()+
  facet_wrap(vars(region))

ggplotly(New_Card)
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.