#Now I use the 3 new objects (meanprice1,2,3) to make new heatmaps.
heatmap1 <- meanprice1 %>% ggplot(aes(x=minimum_nights,
y=neighbourhood, fill = AveragePrice))+
geom_tile(color ="grey")+
scale_fill_gradientn(colours = c("darkgreen","lightyellow", "yellow","orange","red"))+
scale_y_discrete(label = function(y) stringr::str_trunc(y, 15))+
scale_x_continuous(breaks=seq(1,32, by=2))+
theme(panel.background = element_rect(fill = "white", colour="white"),
aspect.ratio = 1/2,
text = element_text(size=10),
axis.text.y = element_text(size=8),
axis.text.x = element_text(size=8))+
labs(title="Which Neighborhoods Offer the Cheapest Prices? (1/3)",
subtitle="Based on your desired minimum night stay, look for your neighborhood.",
x = "Minimum Night Stay",
y = "Neighborhood")
heatmap2 <- meanprice2 %>% ggplot(aes(x=minimum_nights,
y=neighbourhood, fill = AveragePrice))+
geom_tile(color ="grey")+
scale_fill_gradientn(colours = c("darkgreen","lightyellow", "yellow","orange","red"))+
scale_y_discrete(label = function(y) stringr::str_trunc(y, 15))+
scale_x_continuous(breaks=seq(1,32, by=2))+
theme(panel.background = element_rect(fill = "white", colour="white"),
aspect.ratio = 1/2,
text = element_text(size=10),
axis.text.y = element_text(size=8),
axis.text.x = element_text(size=8))+
labs(title="Which Neighborhoods Offer the Cheapest Prices?(2/3)",
subtitle="Based on your desired minimum night stay, look for your neighborhood.",
x = "Minimum Night Stay",
y = "Neighborhood")
heatmap3 <- meanprice3 %>% ggplot(aes(x=minimum_nights,
y=neighbourhood, fill = AveragePrice))+
geom_tile(color ="grey")+
scale_fill_gradientn(colours = c("darkgreen","lightyellow", "yellow","orange","red"))+
scale_y_discrete(label = function(y) stringr::str_trunc(y, 15))+
scale_x_continuous(breaks=seq(1,32, by=2))+
theme(panel.background = element_rect(fill = "white", colour="white"),
aspect.ratio = 1/2,
text = element_text(size=10),
axis.text.y = element_text(size=8),
axis.text.x = element_text(size=8))+
labs(title="Which Neighborhoods Offer the Cheapest Prices? (3/3)",
subtitle="Based on your desired minimum night stay, look for your neighborhood.",
x = "Minimum Night Stay",
y = "Neighborhood")
heatmap1