I have a data frame with latitude
, longitude
, and a number
. I want to add markers that are colored corresponding to these numbers. The numbers start at 1 and can be up to 100 or more.
Optimally, I would like markers with a value <= 1 to be orange, <=10 to be dark orange, <=50 to be red, and >=50 to be purple.
This seems like a simple idea, but I can't quite figure it out. I tried to use the Awesome Icons (though I would rather not) from the leaflet site (scroll down to the if statement in the Awesome Icon section), but that method was actually not working for me, and all the markers were red.
lat lon number
1 19.59917 -155.42009 3
2 22.21065 -159.47324 120
3 22.21407 -159.59058 7
4 24.54509 -81.70717 49
5 24.54630 -81.81060 1
6 24.55411 -81.80333 11
Above is sample data. It is part of a shiny app.