reverse order in R leaflet continuous legend
<p>I am trying to reverse the value display of my <code>leaflet</code> legend in R. This <a href="https://stackoverflow.com/questions/31413586/r-leaflet-legend-specify-order-instead-of-alphabetical">post</a> covers categorical data, but I am working with continuous data. Here's a toy example:</p>

<pre><code>map &lt;- leaflet() %&gt;% addProviderTiles('Esri.WorldTopoMap')
x &lt;- 1:100
pal &lt;- colorNumeric(c("#d7191c","#fdae61","#ffffbf","#abd9e9", "#2c7bb6"), x)
map %&gt;% addLegend('topright', pal=pal, values=x)
</code></pre>

<p>I'd like the legend to read 100 at the top and 1 on the bottom with the colors reversed. I can certainly reverse the colors in <code>colorNumeric()</code>, but reversing the order of the labels is harder. I have tried reversing the order of the values in <code>x</code>, and I even fiddled with the <code>labelFormat()</code> parameter for <code>addLegend()</code> to reference a lookup table of reversed values... nothing seems to work. Is there an easy way to do this?</p>