My ggplot2 cheat sheet: Search by task
There’s a reason ggplot2 is one of the most popular add-on packages for R: It’s a powerful, flexible and well-thought-out platform to create data visualizations you can customize to your heart’s content.
But it also can be a bit overwhelming. While I find the logic of plot layers to be intuitive, some of the syntax can be a bit of a challenge. Unless you do a lot of work in ggplot2, I’m not sure how easy it is to remember that, for example, the simple task of “make my graph title bold” requires the rather wordy theme(plot.title = element_text(face = "bold")).
So I’ve come up with a two-step method that’s drop-dead simple — at least for me — to do my most common dataviz tasks in ggplot2. I hope it will help you, too.
To read this article in full or to leave a comment, please click here
leave a reply: