Recent Posts

The timeplyr R package, created by my colleague Nick, was accepted on CRAN in October 2023. A direct quote from the CRAN page is that …

I just wrote a post about grouped sequences in dplyr and following that, I’ve been made aware of another couple of solutions to this …

For a piece of work I had to calculate the number of matches that a team plays away from home in a row, which we will call …

Combining case_when() and across() If you want to use case_when() and across() different variables, then here is an example that can do …

This blog post is just a note that when you try to do a grouped summary of a date variable but some groups have all missing values, it …

Projects

*

R Training Resources and Tips

A short list of resources and tips to help with learning some R basics, with particular focus on the tidyverse.

phstemplates

An R package containing standard templates for use by Public Health Scotland.

objectremover RStudio Addin

An RStudio addin to assist with removing objects from the global environment. Features include removing objects according to name patterns and object type.

Recent & Upcoming Talks

A quick summary and demo of my experience of using the redoc package.

Recent Publications

Quickly discover relevant content by filtering publications.

We investigated associations between outcomes and DAA treatment by comparing post-treatment to baseline periods using a within-subjects …

The aim of this study was to assess the effect of the ‘How to save a life’ campaign on the supply of take-home naloxone

This study compared mortality rates for patients treated for hepatitis C in the era of direct acting antivirals with the general …

We assessed the extent to which opioid-agonist therapy is protective against drug-related mortality in Scotland

We compared the predicted hepatocellular carcinoma probability for individuals with cirrhosis and cured hepatitis C with the general …