Hi guys,
Can you guys please clear me from these examples Leaflet for R - Using Leaflet with Shiny 2 things ?
1st: What are tilde sings doing here
fitBounds(~min(long), ~min(lat), ~max(long), ~max(lat))
or
addCircles(radius = ~10^mag/10, weight = 1, color = "#777777",
fillColor = ~pal(mag), fillOpacity = 0.7, popup = ~paste(mag)
)
etc.
2nd: How the R can access variable without file/table name ? like it is accessing mag
here.
proxy %>% addLegend(position = "bottomright",
pal = pal, values = ~mag
)
but before that it uses the parent quakes
to access mag
filteredData <- reactive({
quakes[quakes$mag >= input$range[1] & quakes$mag <= input$range[2],]
})
also please why is there a ,
(comma) at the end of index above statement 2]**,**]
? and if not put in it gives error Error in [.data.frame: undefined columns selected
.
Thank you.