Ggplot2

Robert Myles McDonnell

4 minute read

🇨🇨 🇨🇽 🇵🇹 🇩🇴 🇫🇲 🇰🇷 Recently I wrote a little package for R called flagfillr (you can read more details here). One of the main reasons I made this is because I had seen a few maps of economic partners, for example this one, from here: These types of maps (some more here, of the US) are interesting visual summaries, but they look a little Excel to me (sorry, whoever made it!

Robert Myles McDonnell

4 minute read

I’ve been working on a project where the client wanted a “cockpit” style dashboard, with meter/gauge/speedometer type things. Even though this wasn’t likely to be implemented in R for the final version, I started thinking about how I could do this with ggplot2, influenced by some code from here. Base R graphics are likely a much better fit for something like this, as Gaston Sanchez’s example shows, but I actually quite like the result with ggplot2.

Robert McDonnell

3 minute read

I loved this R script from hdugan when I first saw it a while ago. The script makes a 2-page pdf of all the colors available in R, using R. Nice. The other day, I thought about making a tidyverse version of it, using dplyr to get the data ready and ggplot2 to visualize it. I won’t for a second pretend that this code is as short and tidy as the original, and in fact it may be a good example of when base R can be really useful, but anyway here it is.