Something is wrong with the code but I can't figure out what. I am trying to plot the coefficients of a geographically weighted regression on a map showing the districts of Barcelona. I can get R to plot the points or the map but I am unable to overlay them. What could be the issue?
ggplot(logairbnb, aes(x=x,y=y))+
geom_point(aes(colour=logairbnb$coefdist_center))+
scale_colour_gradientn(colours = terrain.colors(10),
guide_legend(title="Coefs"))
ggplot(neighbourhood_fortified, aes(long,lat,colour =
factor(id))) +
geom_polygon(fill = "white", colours =
terrain.colors(10))+coord_equal()
Something weird happens with the axes when I try to overlay the graphs
gwr.point1<-ggplot(logairbnb, aes(x=x,y=y))+
geom_point(aes(colour=logairbnb$coefdist_center))+
scale_colour_gradientn(colours = terrain.colors(10), guide_legend(title="Coefs"))
gwr.point1+
geom_polygon(data=neighbourhood_fortified,aes(long,lat,group=id),colour="grey")
Okay, so I found out this works.