library(tidycensus)
library(tidyverse)
library(sf)
library(ggplot2)
library(classInt)
kz_acs <- get_acs(geography = "tract",
                state="MI",
                county = "Kalamazoo",
                year = 2019,
                variables=c("DP05_0001E", "DP03_0119PE", "DP03_0062E") ,
                geometry = T,
                output = "wide")
## Getting data from the 2015-2019 5-year ACS
## Downloading feature geometry from the Census website.  To cache shapefiles for use in future sessions, set `options(tigris_use_cache = TRUE)`.
## Using the ACS Data Profile
head(kz_acs)

library(mapview)
library(RColorBrewer)
hhmed_map$hhmed_jbrks<-relevel(hhmed_map$hhmed_jbrks,ref = "0-23145" )

pal <- colorRampPalette(brewer.pal(7, "Blues")) #set colors

mapview(hhmed_map,
        zcol="hhmed_jbrks",
        legend=T,
        map.types="OpenStreetMap",
        layer.name="Median Household Income")