0

I recently changed my server provider. I have a shiny app and I'm using leaflet.extras

I installed the library (I've checked it twice) but in the new server appears:

Error: could not find function "addSearchMarker"

I have exactly the same shiny files in both servers. Can't figure out what's going on.

You can see it here:

New: http://casadelasestrategias.com:3838/mapadevida/

Old: http://192.95.56.146:3838/mapadevida/

PD: I've also installed the library using install.packages and devtools::install_github functions

PD2: I've tried to add leaflet.extras:::addSearchMarker but it throws "object not found"

PD3: I'm sure addSearchMarker function is from leaflet.extras (there is also same function in leafletplugins package)

PD4: I've called library(leaflet.extras) in ui.R and server.R

Aleharu
  • 170
  • 1
  • 9

1 Answers1

0

I think I found the problem.

I installed package("leaflet.extras"), library(leaflet.extras), and then called addSeachMarker(), and the program could not find it. After a bit of research I found the package is in fact leafletplugins which is not available for the current version of R, which is why when you upgraded to the new server, the package is not in use.

> install.packages("leafletplugins")
Warning in install.packages :
package ‘leafletplugins’ is not available (for R version 3.5.0)

More information here, https://github.com/asmith26/leafletplugins/blob/master/man/addSearchMarker.Rd

Edit: the older version of leaflet.extra (0.2) had the addSearchMarker() function under the searchOSM feature, but the newest version of leaflet.extras (1.0.0) does not have this feature.

Chabo
  • 2,842
  • 3
  • 17
  • 32
  • But I have the function in leaflet.extras, check it here: https://ibb.co/eJFrJT I have not installed leafletplugins package in my computer – Aleharu Jun 05 '18 at 15:51
  • what version of `leaflet.extras` do you have? – Chabo Jun 05 '18 at 15:57
  • leaflet.extras 0.2 in R 3.4.4 – Aleharu Jun 05 '18 at 16:03
  • 1
    Okay, so the newest version 1.0.0 does not have the `addSeachMarker` function in the searchOSM argument. I am guessing the server is running an updated version of the leaflet.extras package and this is why it works in R-studio with the older version, but no the new verison 1.0.0 – Chabo Jun 05 '18 at 16:05
  • True! I have to install it from source version 0.2!! Thank you! – Aleharu Jun 05 '18 at 18:26