Page 1 of 1

library(tidyverse) library(ggplot2) library(tidycensus) options(tigris_use_cache = TRUE) options(tigris_class="sf") read

Posted: Thu Jul 14, 2022 2:12 pm
by answerhappygod
library(tidyverse)library(ggplot2)library(tidycensus)options(tigris_use_cache = TRUE)options(tigris_class="sf")readRenviron('~/.Renviron')
census_api_key("")
va_counties<-counties("VA", cb=T)
tricity_region<-filter(va_counties, COUNTYFP %in%c("730","570","041","053","149"))
snap_data <- get_acs( geography = "tract", state = "51", variables = (c( all_snap = "B22007_001", recieve_snap = "B22007_002", no_snap = "B22007_023" )), year = 2020, geometry = TRUE, cache=T) %>% mutate(percent = 100 * (moe / estimate))
head(snap_data)
Instructions: (use the codes above to pull thedata)
1. Use the ACS data to create bar charts,histograms or any other diagrams that show SNAPdata for the following regions in Virginia (Petersburg, Hopewell,Colonial Heights, Prince George, & Dinwiddie)
2. Use ggplot2, leaflet or tm_shape to createmaps to show the SNAP data for the regions inVirginia (Petersburg, Hopewell, Colonial Heights, Prince George,& Dinwiddie)
NB: CODES SHOULD BE WRITTEN IN R (RSTUDIO)
Please add where to find website links if using CSVfiles to read in data (make downloading CSV files easy tofind)
NB: Please do not copy Rladies data on education for aresponse. I have received the same code for questions that the codehave no relevance for