Setting the Graphics Device in a RMarkdown Document

In our recent post about saving R graphics, it became obvious that achieving consistent graphics across platforms or even saving the “correct” graph on a particular OS was challenging. Getting consistent fonts across platforms often failed, and for the default PNG device under Windows, anti-aliasing was also an issue. The conclusion of the post was

Saving R Graphics across OSs

R is known for it’s amazing graphics. Not only ggplot2, but also plotly, and the other dozens of packages at the graphics task view. There seems to be a graph for every scenario. However once you’ve created your figure, how do you export it? This post compares standard methods for exporting R plots as PNGs/PDFs

Styling ggplot2 Graphics

Styling ggplot2 graphics In our previous post, we demonstrated that contrary to popular opinion, it is possible to generate attractive looking plots using just base graphics. Although we did confess, that it did take a lot of time and effort. In this post, we repeat the same exercise. Using the dreaded iris data set, we’ll

Styling Base R Graphics

Publication quality base R graphics Fixing the problem Why not use ggplot2 (or something else)? Publication quality base R graphics Base R graphics get a bad press (although to be fair, they could have chosen their default values better). In general, they are viewed as a throw back to the dawn of the R era.

Comparing plotly & ggplotly plot generation times

Prerequisites Analysis Summary The plotly package. A godsend for interactive documents, dashboard and presentations. For such documents, there is no doubt that anyone would prefer a plot created in plotly rather than ggplot2. Why? Using plotly gives you neat and crucially interactive options at the top, whereas ggplot2 objects are static. In an app we