Publications by R on Nicola Rennie

Working with colours in R

09.01.2025

When you create a data visualisation using R (or any other software), a set of default colours is used. These aren’t always the most effective, or aesthetically pleasing, set of colours. That means that, at some point, you’ll likely want to use a different set of colours that you have chosen. This blog post will cover how to define those colour...

12829 sym R (1888 sym/32 pcs) 24 img 16 tbl

Introducing the {messy} package

02.12.2024

When teaching examples using R, instructors often use nice datasets, but these aren’t very realistic, and aren’t what students will later encounter in the real world. Real datasets have typos, missing values encoded in strange ways, and weird spaces – to name just a few issues. At the same, it’s quite rare to teach a module solely on data w...

3492 sym R (927 sym/14 pcs) 2 img 7 tbl

Parameterized plots and reports with R and Quarto

27.10.2024

Last week I ran a workshop on Parameterized plots and reports with R and Quarto as part of the R/Pharma conference, which I thoroughly enjoyed! There were lots of interesting questions from attendees during the workshop, some of which we didn’t quite have time to get to during the workshop. So this blog post will attempt to answer those questions...

14544 sym R (1983 sym/28 pcs) 4 img 14 tbl

Getting started with generative art

30.09.2024

Last month, as part of the RSS pre-conference workshop for early career statisticians organised by the Young Statisticians Section, I delivered a workshop on Getting started with generative art. The slides from the workshop can be found online. I’ve now finally gotten around to writing up the workshop as a blog post which will explain what genera...

12123 sym R (1109 sym/12 pcs) 16 img 6 tbl

Creating typewriter-styled images in R

31.07.2024

In September 2023, I wrote a blog post about creating typewriter-styled maps in {ggplot2}. It described the process of creating an elevation map where, instead of using colours to denote the different elevation levels, different letters of the alphabet were used. By choosing the correct font, it gives the impression that the map was created using a...

10024 sym R (1420 sym/28 pcs) 12 img 14 tbl

What’s new in {PrettyCols} 1.1.0?

19.06.2024

Back in September 2022 I submitted {PrettyCols}, an R package containing aesthetically pleasing colour palettes, to CRAN. If you missed it, you can read the blog post introducing the package! Over a year after the last CRAN release, it was time for an update and this blog post will give you a brief overview of some of the new features and palettes!...

3148 sym R (840 sym/12 pcs) 10 img 6 tbl

Coloured text in {ggplot2}: {ggtext} vs {marquee}

03.06.2024

When you use colour to denote the values of a variable in a visualisation, it’s very common to add a legend showing how the colours map to different values. If you create your charts using {ggplot2}, a legend is added automatically when you add colour or fill within the aesthetic mapping. One problem with these legends is that they take up a lot ...

6414 sym R (2185 sym/26 pcs) 10 img 13 tbl

Creating R tutorial worksheets (with and without solutions) using Quarto

30.05.2024

When I’m teaching R, I often have exercise questions for students to work through during our workshop sessions. So I need to create a tutorial worksheet. Although we often go through solutions to the exercises in the workshop, I also want to create a solutions sheet that students can take home – containing the answers to the questions and some ...

7960 sym R (1073 sym/16 pcs) 4 img 8 tbl

A webR powered Shiny app for browsing TidyTuesday plots

25.03.2024

A Shiny app that automatically updates every week without the need to re-deploy it? Without the need to host a server running R? Sound too good to be true? It’s not. Read on for an overview of how I built a Shiny app to browse and display my #TidyTuesday plots, which automatically updates every time I make a new plot. What is #TidyTuesday? For t...

12439 sym R (7555 sym/30 pcs) 6 img 15 tbl

Answering some ‘Forecasting with GAMs in R’ questions

25.02.2024

Last week I had the pleasure of running the Forecasting with generalised additive models (GAMS) in R workshop organised by Forecasting for Social Good. During the workshop, we covered what GAMs are and why we might want to use them, fitting GAMs in R with {mgcv}, evaluating models, making forecasts, and some of the reasons that GAMs might not work...

7897 sym R (189 sym/6 pcs) 4 img 3 tbl