Skip to content

Instantly share code, notes, and snippets.

@robwschlegel
Created November 27, 2017 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwschlegel/2d8ed28f777e75ad93a716613a3021e1 to your computer and use it in GitHub Desktop.
Save robwschlegel/2d8ed28f777e75ad93a716613a3021e1 to your computer and use it in GitHub Desktop.
# 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