Skip to content

Instantly share code, notes, and snippets.

@njtierney
Created October 21, 2020 01:52
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 njtierney/330b0a552b49f38cdd0413afc6896baa to your computer and use it in GitHub Desktop.
Save njtierney/330b0a552b49f38cdd0413afc6896baa to your computer and use it in GitHub Desktop.
library(leaflet)
leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
add_birthplace_marker <- function(map, popup = "The birthplace of R"){
map %>%
addMarkers(lng=174.768, lat=-36.852, popup= popup)
}
leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
add_birthplace_marker()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment