I am trying to reverse the colors of a choropleth map. I am using the leaflet package and the colorNumeric()
function, here is the code that generates the palette function:
pal <- colorNumeric(palette = "YlGnBu", domain = foo$p)
I would like to do something like that:
pal <- colorNumeric(palette = "YlGnBu", domain = foo$p, trans='reverse')
Does anyone knows how to do this?