leaflet() %>%
addTiles() %>%
addCircles(lng = -72.680663, lat = 42.448013, radius = 10, color = "#03F", weight = 3)
Hi! Our group is using the leaflet package. We are trying to figure out what units the radius argument takes in the addCircles()
function.
According to the documentation, radius is: a numeric vector of radii for the circles; it can also be a one-sided formula, in which case the radius values are derived from the data (units in meters for circles, and pixels for circle markers)
Is there a way for us to set the units the radius is in? What is the default unit radius is set it?
Circle that shows up with radius of 10 entered:
It looks like meters. According to the Wikipedia, the Astrodome has a 110m radius, and if you plot that:
leaflet() %>%
addTiles() %>%
addCircles(lng = -95.407778, lat = 29.685, radius = 110)
it lines up almost perfectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With