Created
November 27, 2017 19:06
-
-
Save robwschlegel/2d8ed28f777e75ad93a716613a3021e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create base map | |
world_map <- ggplot() + | |
borders(fill = "grey40", colour = "black") | |
# Create titles | |
titles <- c("Deurmekaar", "Sequential", "Islands") | |
# Plotting function | |
plot_sites <- function(site_list, buffer, title_choice){ | |
world_map + | |
geom_point(data = site_list, size = 6, | |
aes(x = lon, y = lat, colour = as.factor(order))) + | |
coord_cartesian(xlim = c(min(site_list$lon - buffer), | |
max(site_list$lon + buffer)), | |
ylim = c(min(site_list$lat - buffer), | |
max(site_list$lat + buffer))) + | |
labs(x = "", y = "", colour = "Site\norder") + | |
ggtitle(titles[title_choice]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment