ggplot2

How to arrange ggplot (barplot) bars in ascending or descending order

One of the reasons you’d see a bar plot made with ggplot2 with no ascending / descending order - ordering / arranged is because, By default, ggplot arranges bars in a bar plot alphabetically. But most of the times, it would make more sense to arrange it based on the y-axis it represents (rather than alphabetically). It could be your month-wise time series or high-medium-low bars - these are some examples where an alphabetically-sorted bar chart wouldn’t make sense in fact would hinder the process of data communication.

How to make your Facet Wrap / Facet Grid ggplots span across multiple pages in PDF

This is going to be a very short post. It’s a problem I faced a few days back and after some DDGing, Github Issues scanning and some SOing - I found the answer. So, I thought to share it - for archival and also my future reference. Problem The problem here is when you use facet_grid() or facet_wrap() of ggplot inside an R chunk of an Rmd (Rmarkdown) file. The rendered PDF wouldn’t show those faceted multiple plots in multiple pages instead just embedded one on top another in the same page.