I have a leaflet map that will render fine from a script file but not from R markdown.
The code is:
addPolygons(weight = 1,
label = ~hr,
color = ~map_palette(hr)) %>%
addMarkers(data = shared_data,
label = ~paste(pn,
"Number :", dn)) %>%
addLegend(pal = map_palette, values = ~hr, group = "circles", position = "bottomleft", title = "HD")
the error message reads:
Error in validateCoords(lng, lat, funcName) :
addMarkers requires numeric longitude/latitude values
Calls: ... -> addMarkers -> derivePoints -> validateCoords
I have tried to find a solution including updating RStudio but drawn a blank
Does anyone out there have an answer?