When using Leaflet in R, I assumed that plotting layers (ala ggplot) would be effective:
m <- leaflet() %>%
addTiles() %>%
addCircleMarkers(lat=subset(DF, outcome=='W')$lat, lng=subset(DF, outcome=='W')$lon, color= "red") %>%
addCircleMarkers(lat=subset(DF, outcome=='L')$lat, lng=subset(DF, outcome=='L')$lon, color= "blue")
I had assumed that this would give me two different colored circle markers, red markers for those records that had 'W' outcomes, and blue markers for records that had 'L' outcomes.
Instead, I don't get any map at all.
How can I pipe multiple addCircleMarkers
in sequence using Leaflet in R?