bluefoxr / COINr

COINr
https://bluefoxr.github.io/COINr/
Other
25 stars 7 forks source link

[refactor] add coord_flip() to plot_bar() #38

Closed Edouard-Legoupil closed 1 year ago

Edouard-Legoupil commented 1 year ago

In plot_bar()

simply using plot_bar() + coord_flip() does not work as it then not sorted from high to low.

Better would be to add it directly as an option in the function

image

bluefoxr commented 1 year ago

Sorting the bar chart (especially stacked) in ggplot2 is suprisingly fiddly, so I think this would take a bit of effort to sort out. At the end of the day, users can also build their own plots so I see this outside of the scope of COINr. Feel free to make a PR though if you know how to do it and I will merge it into the package if it works.

bluefoxr commented 1 year ago

Actually I changed my mind on this! See commit above.