0
votes

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

1
Do you have any other libraries being loaded into the server, and if so are they working correctly? - Chabo
@Chabo yes! I have a lot of them and they are working correctly (even in other shiny apps) - Aleharu
Using the application within R studio produces no problems, correct? - Chabo
@Chabo correct, it's working fine within R studio - Aleharu

1 Answers

0
votes

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.