# NOT RUN {
if (interactive()) {
library(sf)
library(leaflet)
library(lattice)
pt = data.frame(x = 174.764474, y = -36.877245)
pt = st_as_sf(pt, coords = c("x", "y"), crs = 4326)
p2 = levelplot(t(volcano), col.regions = terrain.colors(100))
leaflet() %>%
addTiles() %>%
addCircleMarkers(data = pt, group = "pt") %>%
addPopupGraphs(list(p2), group = "pt", width = 300, height = 400)
}
# }
Run the code above in your browser using DataLab