knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE )
library(tableauexplosites)
downloaded_sites <- rcoleo::download_sites_sf() library(tidyverse) library(leaflet) downloaded_sites %>% slice(1) %>% leaflet(options = leafletOptions(maxZoom = 7)) %>% addProviderTiles(providers$Esri.NatGeoWorldMap) %>% addMarkers()
wrap it in a function
plot_one_point <- function(dl_sites, chosen){ subset(dl_sites, dl_sites$site_code == chosen) %>% leaflet(options = leafletOptions(maxZoom = 7)) %>% addProviderTiles(providers$Esri.NatGeoWorldMap) %>% addMarkers() } plot_one_point(downloaded_sites, "146_133_H01")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.