Jenny Goldberg Intro to GIS Final Project

Loading Packages/Libraries

library(tidyverse)
library(ggplot2)
library(scales)
library(viridis)
library(RColorBrewer)
library(forcats)

Uploading/Manipulating Data

data<-read_csv("means.csv")


data2<-data |>
  mutate(Code2 = fct_relevel(data$Code, 
                            "Base", "Stretch", "Specialized", 
                            "Pilot"))

display.brewer.all(type="seq")

Visualizing Data Sets with GGplot

#Median Household Income by Code
ggplot(data2,aes(x=Code2,y=MHI,fill=Code2)) +
 geom_col(show.legend = FALSE)+ 
  scale_fill_brewer(type="seq",palette = "OrRd")+
  labs(x="",y="Median Household Income ($)")+
  scale_y_continuous(labels = scales::number_format(accuracy = 1))+
  theme_minimal()

#Median Single Family Home Price by Code
ggplot(data2,aes(x=Code2,y=Price,fill=Code2)) +
  geom_col(show.legend = FALSE)+ 
  labs(x="",y="Median Single Family Home Price ($)")+
  scale_fill_brewer(type="seq",palette = "Blues")+
  scale_y_continuous(labels = scales::number_format(accuracy = 1))+
  theme_minimal()

#SHI by Code
ggplot(data2,aes(x=Code2,y=Affordability,fill=Code2)) +
  geom_col(show.legend = FALSE)+ 
  labs(x="",y="% Affordable Housing Stock")+
  scale_fill_brewer(type="seq",palette = "BuGn")+
  scale_y_continuous(labels = scales::number_format(accuracy = 1))+
  theme_minimal()