# NOT RUN {
country <- esp_get_country()
Roads <- esp_get_roads()
library(ggplot2)
ggplot(country) +
geom_sf(fill = "grey90") +
geom_sf(data = Roads, aes(color = tipo), show.legend = "line") +
scale_color_manual(
values = c("#003399", "#003399", "#ff0000", "#ffff00")
) +
guides(color = guide_legend(direction = "vertical")) +
theme_minimal() +
labs(color = "Road type") +
theme(legend.position = "bottom")
# }
Run the code above in your browser using DataLab