r-spatial / leafpop

Include Tables, Images and Graphs in Leaflet Popups
Other
113 stars 15 forks source link

could not find function "addPopupGraphs" #7

Closed git-ashish closed 5 years ago

git-ashish commented 5 years ago

Hello,

I am trying out the popUpGraph example but facing an error.

library(sf)
library(leaflet)
library(lattice)

pnt = st_as_sf(data.frame(x = 174.764474, y = -36.877245),
                coords = c("x", "y"),
                crs = 4326)

p2 = levelplot(t(volcano), col.regions = terrain.colors(100))

leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = pnt, group = "pnt") %>%
  addPopupGraphs(list(p2), group = "pnt", width = 300, height = 400)

image

Error in addPopupGraphs(., list(p2), group = "pnt", width = 300, height = 400) : could not find function "addPopupGraphs"

I was able to run the backward compatibility example though:

leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = pnt, popup = popupGraph(p2, width = 300, height = 400))

Thanks!

tim-salabim commented 5 years ago

Did you load leafpop via library(leafpop)? And did you install it from github? The addPopup*() functions are not on CRAN yet

git-ashish commented 5 years ago

Got it. Uninstalled and re-installed from Github repo remotes::install_github("r-spatial/leafpop"). This solved the error. Thank you!