I am working with leaflet package to draw maps and plot lat and long on the plot. I am doing following in R.
m <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=df_final$order_long, lat=df_final$order_lat)
m
It works perfectly fine in R console. But It doesn't work when I use it in shiny
This is my ui.r
code snippet
tabPanel("Order Locations", leafletOutput("map", width = "80%", height =
"80%"))
and this is server.r
code snippet
output$map<- renderLeaflet({
dataset<-dataUpload()
leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=dataset$order_long,lat=dataset$order_lat)
})
It doesn't display anything. Where I am getting wrong. please help