R plotly barplot, sort by value
<p>I have a barplot with categories on X axis and counts on Y. Is there a way to sort the bars in descending order on values of Y?</p>

<p>this is the sample code</p>

<pre><code>Animals &lt;- c("giraffes", "orangutans", "monkeys")
Count &lt;- c(20, 14, 23)
data &lt;- data.frame(Animals, Count)

data &lt;- arrange(data,desc(Count))

plot_ly(data, x = ~Animals, y = ~Count, type = 'bar', name = 'SF Zoo')
</code></pre>

<p>Despite of arranging the data by count before the plot, I still get bars sorted alphabetically by animal names.</p>

<p>thanks,
Manoj</p>