I like to set up a standardised directory structure for RStudio projects. The idea came from here. In brief, the structure is: My typical workflow is therefore to: So far, so good. However, this process is a bit tedious. I find it irritating to open up RStudio (which opens up a previous project by default) […]

# Category: adventures in code

## Over and Over: quick ways to reuse handy shell one-liners

There are a few one-liners that I use in the shell to do some really nifty stuff. I struggle to quickly find and reuse these and asked for a solution on Mastodon. A handy one-liner might be something like (taken from here): This converts all the flac files in subfolders into mp3 files. Obviously, we […]

## Twitcher II: tweet frequency and top tweets

Another post looking at Twitter data in R. It follows this one and this one. I wanted to look again at my tweeting frequency over the 12 years on Twitter, but this time do it in a calendar view. Something like a GitHub commit calendar would be perfect. I have used a library for this […]

## Any Time At All: tweet frequency around the clock

Please consider this a “supplementary analysis” to my previous post looking at the frequency of tweets from my personal account over the last 12 years. I was curious about what times I was active on Twitter (measured by when I tweeted). Others might be interested in a solution to look at this in R. The […]

## Twitcher: tweet frequency over the years

At the time of writing, I have essentially left Twitter. It was a fun ride and without going into what’s happening there now, this is a good opportunity to look at my 12 years on the platform. Early in November, I downloaded my data and locked my Twitter account. This gave me all the data […]

## The Package: learning how to build an R package

I recently made my first R package and was asked how I did it. The answer of course was: I searched, read, and stumbled around until it was done. But having gone through the process I figured it was worthwhile summarising what I did and what I found tricky. First off, there are a ton […]

## In Circles: fitting a circle to a curve

A comment from a referee led me to find a method to describe curvature of membranes. This is a quick write-up of our solution. I couldn’t find a solution readily available in Fiji, so I created one using a combination of Fiji for tracing the curvature and IgorPro to do the fitting. If there is […]

## Latin Quarter: Colours and Latin Squares

I read about aesthetic uses of Latin Squares on John Cook’s site a few months ago. Since I maintain a resource to use colour tables in Igor Pro, I thought it would be fun to use Latin Squares to display colour tables for easy visualisation. Briefly, I wrote some code to generate a 9 x […]

## Seles II: Tennis coding challenge solution

In a previous post, I described a coding challenge sent to me by my colleague. Here is the challenge again: There is a tennis match between two players denoted 1, and 2. You are given a sequence of 1s and 2s whereby each number denotes a point won by player 1 or player 2 (e.g. […]

## Seles: Tennis coding challenge

A colleague sent me a coding challenge. This is a short post to describe how I tackled it. Edit: a follow-up post is here. This is the challenge: There is a tennis match between two players denoted 1, and 2. You are given a sequence of 1s and 2s whereby each number denotes a point […]