hey all, I keep getting an error when trying to solve for this.. the error I'm getting is "Error in ggplot(plot_map, aes(lng, lat)) : object 'plot_map' not found any insights would be greatly appreciated.
library(zipcodeR)
library(tidyverse)
library(maps)
library(ggplot2)
vendavo <- read.csv("C:/Users (ETC).
zip_code_db <- zip_code_db %>% select(zipcode,lat,lng)
us<-map_data('state')
#format the data (this is probably just me)
df2 <- df2 %>%+
mutate('GeographyLevel5' = as.numeric('GeographyLevel5')+
mutate('zipcode' = as.numeric('zipcode'),
plot_map <- vendavo %>%
select(GeographyLevel5,TargetPrice,QuoteStatus) %>%
left_join(zip_code_db,by = c("GeographyLevel5" = "zipcode"))
####
ggplot(plot_map,aes(lng,lat)) +
geom_polygon(data=us,aes(x=long,y=lat,group=group),color='gray',fill=NA,alpha=.35)+
geom_point(aes(color = TargetPrice),size=1,alpha=.75) +
xlim(-125,-65)+ylim(20,50)+
scale_color_gradient(low="green", high="red")+
theme_bw()+
facet_wrap(~QuoteStatus)+
labs(x = "longitude",
y= "Latitude",
title = "Pricing Data")+
theme(plot.title = element_text(hjust = 0.5))