# Assuming you have already loaded the tidyverse package and read the raw data # Select columns needed for graphing graph_data <- raw_data %>% select(Geography, BEA_PCPI, ACS_PCMI) # Reshape the data to long format long_graph_data <- graph_data %>% pivot_longer(cols = c(BEA_PCPI, ACS_PCMI), names_to = "Income_Type", values_to = "Income_Value") # Graphing with ggplot library(ggplot2) ggplot(long_graph_data, aes(x = Geography, y = Income_Value, fill = Income_Type)) + geom_bar(stat = "identity", position = "dodge", color = "black") + labs(title = "Comparison of PCPI and PCMI by Geography", x = "Geography", y = "Income Value") + scale_fill_manual(values = c("BEA_PCPI" = "blue", "ACS_PCMI" = "red")) + theme_minimal()