Publications by R on Nicola Rennie

Four ways to streamline your R workflows

30.12.2023

In previous years, when it gets to the end of the year, I’ve written blog posts about reflecting on a year of #TidyTuesday data visualisations, or making your own #RStats Wrapped in the style of SpotifyWrapped. This year, I wanted to reflect on some of the changes I’ve made to the way I write R code that have helped to streamline my workflows...

7751 sym 6 img

Creating typewriter-styled maps in {ggplot2}

29.09.2023

A couple of months ago I read a blog post by RJ Andrews, in which he described the process of making a map of California using a typewriter. It’s a beautiful map – made using over 2,500 keystrokes, all done by hand. The density of ink for each letter displays the elevation. He notes that he’s not the first to make maps using a typewriter. I ...

6903 sym R (2436 sym/24 pcs) 16 img 12 tbl

Creating template files with R

21.08.2023

Over the past few months, I’ve found myself fine-tuning the structure of my R scripts for #TidyTuesday, and each week they have similar sections: load packages, load data, data wrangling, make a plot, save the plot, and so on. What I’ve ended up doing recently is copying and pasting the script from the previous week, and then removing the unne...

7276 sym R (6502 sym/22 pcs) 4 img 11 tbl

Adding social media icons to charts with {ggplot2}

26.07.2023

When I’ve created data visualisations with {ggplot2} recently, I’ve been adding icons with my social media details in the caption. It’s a great, concise way to put your name on your work, and make it easy for people to find your profile if they see your work elsewhere. Tanya Shapiro was the first person I saw doing this in R – so full cred...

5318 sym R (589 sym/10 pcs) 10 img 5 tbl

Learning Julia with #TidyTuesday and Tidier.jl

31.05.2023

Learning a new programming language can be tricky, and it can sometimes lead to more ways of getting confused – even in languages you know well! I always mix up len() and length()… When returning to Python after primarily working in R for a while, I found Shiny for Python a really good resource for learning. The concepts were similar enough th...

5713 sym R (1244 sym/16 pcs) 8 img 8 tbl

Introducing {ggflowchart}

11.05.2023

Back in April 2022, I participated in the #30DayChartChallenge and for the Storytelling prompt on day 29 in the Uncertainty category, I created the Goldilocks Decision Tree. I also gave a talk to R-Ladies Nairobi on the challenge and used the flowchart as a live-coding example. A summary of the talk ended up as a blog post. The reactions were ...

5989 sym R (788 sym/14 pcs) 11 img 7 tbl

Creating a cracked egg plot using {ggplot2} in R

03.05.2023

You can’t make an R plot without breaking eggs… that’s how the saying goes, right? A recent #TidyTuesday data set explored US egg production and, thanks to an excellent suggestion from Tanya Shapiro to create a plot in the style of the Visual Capitalist US egg prices chart, and Deepali Kank’s incredible version of it, I decided to figur...

5572 sym R (4272 sym/30 pcs) 18 img 15 tbl

Detecting heart murmurs from time series data in R

13.04.2023

Time series data often contains information that’s not easily seen when simply visualising the data. We can uncover these hidden features using time series analysis, and use them to classify time series that exhibit similar features. Data In this blog post, we’ll extract features from and classify time series relating to sound recordings of pa...

15244 sym R (9345 sym/34 pcs) 12 img 18 tbl

Scraping London Marathon data with {rvest}

15.03.2023

There are lots of ways to get data into R: reading from local files or URLs, R packages containing data, using packages that wrap APIs, to name a few. But sometimes, none of those are an option. Let’s say you want get a table of data from a website (that doesn’t provide API access). You could copy and paste it into a spreadsheet, re-format it m...

5819 sym R (2471 sym/10 pcs) 6 img

Making Pretty PDFs with Quarto

16.02.2023

Quarto is an open-source scientific and technical publishing system that allows you to combine text with code to create fully reproducible documents in a variety of formats. One of those formats is PDF. The default outputs look reasonably good for academic articles, but if you’re making professional reports, a CV, or sending a letter – you prob...

9041 sym R (2891 sym/14 pcs) 6 img