An occasional blog

A disorganised collection of miscellanea, poorly written code, and idle thoughts broadly focused on R programming, cognitive science and statistics. As one might expect from such a description, this is a very serious blog written by a very serious person. I only post essays on other topics elsewhere, lest I detract from the professionalism of which I might otherwise be accused.

  • What good is a bad model?   23 Jan 2020
    An overly-long rambling review of a very interesting paper

  • Unpredictable paintings   15 Jan 2020
    Getting started with generative art

  • Paths in strange spaces, part II   24 Nov 2019
    The second half of a two-part post on preregistration, in which I discuss the importance of documentation and transparency when faced with severe uncertainty.

  • Paths in strange spaces, part I   09 Nov 2019
    The first half of a two-part post on preregistration. In this first half I argue against the proposition that preregistration is a good tool to prevent ‘p-hacking’. In the second half, I will switch gears and talk about why I am more enthusiastic about preregistration as a method to promote transparency.

  • Maps maps maps   10 Oct 2019
    Making good maps is hard

  • Girl you gotta wonder ‘bout a test like that   27 May 2019
    A proposed design for the t-test functions in the tidylsr package.

  • Be some other name   15 May 2019
    A tale of two naming errors, both alike in foolishness, in a mediocre statistics text where we lay our scene.

  • Hey pretty   12 May 2019
    I’m going to start another 100 Days exercise, but this time focusing on topics that I think might be relevant to revising Learning Statistics with R. Oh, and also I wrote my own blogdown theme and am taking it for a spin on my own blog.

  • A metamorphosis, part one   27 Dec 2018
    As Danielle’s Project awoke one morning from uneasy dreams she found herself transformed in her sleep into a git repository. She was lying in a soft RStudio project and when she lifted her head a little she could see her awkward history divided into strange blobs in the bottom of a .git folder from which she felt she could be checked out completely. Her numerous dependencies, which were pitifully fragile compared to the rest of her bulk, were swept wholesale into her body. What has happened to me? She thought.

  • A pretty good year   14 Dec 2018
    I don’t spend enough time reflecting on my achievements. There’s a part of me that feels like it’s narcissistic to do so, but at the same time I am proud of a lot of the things I’ve done. Sometimes it’s nice to take the time to look back, and feel pleased with what you’ve done. It can be a nice antidote to imposter syndrome, I suppose.

  • A loss of confidence   03 Oct 2018
    The idea behind the loss of confidence project is that researchers who no longer believe their own published findings can say so without stigma. Seems totally worthwhile. Okay, sure, the loss of confidence project itself is no longer receiving submissions, but there’s nothing stopping me thinking about my own work and forming some views on what I now think about each paper. I think that’s just an inherently useful exercise

  • Thoughts on participation   21 Sep 2018
    I’ve been thinking a little about what it means to be a good participant in a group discussion. This isn’t a fully developed blog post, so much as a few thoughts that at some point I’ll develop into a guide for students.

  • A personal essay on Bayes factors   15 Sep 2018
    I have mixed feelings about Bayes factors. As Katy Perry once observed, it’s extremely hard to make valid inferences when you aren’t even sure what the hell it is you’re trying to make inferences about. Oh sure, it’s easy enough to tell pretty stories about rational reasoning with respect to a prior, but if we’re going to have a serious statistical relationship you need to bring more than a Dutch book argument to the table.

  • Day 99-100: Progress in small steps   03 Aug 2018
    Sometime back in late April I made a strange decision to try to learn a new R package every day for 100 days. The goal was transparently ridiculous, and even at the time I was aware there was no way I could do it. Of course ‘a package every day’ was never the primary goal. What I’d really hoped to do is get into the habit of trying out new R packages, just for my own curiosity.

  • Day 95-98: Press any key   01 Aug 2018
    I’m getting to the very end of this package tryout exercise, and I suspect this will be the last post (other than perhaps a wrap up on Friday). It’s been a mildly annoying morning: I’ve done something to my foot, I’ve been awake since 4am, and somehow my twitter feed was full of people talking about Jordan Peterson 😒 Sigh. I probably should have just blocked or muted everyone talking about him rather than engage, but what’s done is done and I’d like to enjoy the rest of my morning.

  • Day 82-94: Idle thoughts on my workflow   28 Jul 2018
    Everyone struggles to work out how to organise their projects in a way that suits their situation, their skills and their idiosyncratic style. We’re all clutching at straws here, hoping to find some good tips by looking at what other people do. So even though I make no claims whatsoever as to competence, here’s the constraints I’m working with and what I’ve ended up doing

  • Day 67-81: Dragon taming, Rcpp edition   15 Jul 2018
    After being inspired by recent conferences, I feel brave enough to face one of my deepest fears and learn how to write compiled C++ code for R using the Rcpp package. It isn’t as scary as I thought it would be

  • Day 55-62: R: The boring bits   26 Jun 2018
    It’s been a little longer than usual between posts. I’ve been extremely busy with work, and if you’ll excuse me taking a moment to celebrate achievements I’m really pleased with how it’s been going lately: I’ve wrapped up a few projects and submitted four preprints to PsyArXiv in the last month - here, here, here and here - so yay me! 🎉 It’s always nice to take a moment to celebrate when things actually seem to be going okay.

  • Day 53-54: Rcade   18 Jun 2018
    So, I was going to write a post about the Rcade package, but then I got sidetracked playing Pacman for some reason…

  • Day 51-52: Kabling   16 Jun 2018
    Today’s post is prompted by a real life situation. The R-Ladies Sydney launch event will happen in a few days time, and we’ve been overwhelmed by the number of people signing up. We opened up 75 spaces on the meetup page to fit the capacity of the venue, and not only did we fill it up there are people waitlisted too. Yaaaay! But also, eek! Lots of people means that it might be hard for people to meet and talk and get to know their fellow R-Ladies.

  • Day 39-46: On error bars and other simple data summaries   10 Jun 2018
    The idea behind the ggstatsplot package is very neat. The goal is to provide a very quick and simple way to produce a few standardised plots that would be useful in a lot of behavioural science contexts. I played around with it for a bit.

  • Day 36-37: Concerned DALEX   02 Jun 2018
    In which a Dalek is concerned and the DALEX package is helpful.

  • Day 35: Accidental art with scico   31 May 2018
    A few days ago, while trying to draw a nice contour plot for a paper, I accidentally discovered that when you ask stat_density_2d to draw polygons, it is terribly literal in how it defines those polygons. If the line that defines a particular contour runs outside the plot area, it treats it as the end of the line, so the relevant polygon is closed then and there, so to speak. This isn’t terribly helpful for drawing density plots, but it did lead to some accidental artwork.

  • Day 31-34: Belief elicitation with a Shiny app   30 May 2018
    This is a fairly long post, and I’m a bit too tired today to find fun pictures to go with it. So the short version is that I worked out how to build a Shiny app for a belief elicitation task. I have a long way to go to understand Shiny, but it was a helpful experience.

  • Day 29-30: On the internet, no-one knows your plumber is a magpie   26 May 2018
    (Note - It’s been a busy weekend, and this post is a little late: I did “all” the coding on the 26th though, so I’m totally going to pretend I met my self-imposed deadline 😀) Often when I am bereft of ideas, I go browsing through the awesome R list in search of inspiration, marvelling at all the shiny, shiny packages 📦 that I wish I understood better than I do.

  • Day 28: Fcuk this facet_crap   24 May 2018
    The idea behind the fcuk package is simple and unobtrusive. It captures error messages and when one of those object ‘blahblahblah’ not found messages appears, it suggests possible alternatives. I played around with it and had fun.

  • Days 26-27: Expressions of interest   23 May 2018
    A few days ago I wrote about my first attempt to understand metaprogramming in R, trying to wrap my head around non-standard evaluation using Advanced R. This time around, it’s the expressions section – well the first half of it anyway – and an attempt to go through the looking glass and understand what is going on internally with R expressions.

  • Days 24-25: Trousers to the mast   21 May 2018
    The here package is deceptively simple, but offers a solution to the annoying problem that almost everyone runs into eventually - writing an R script that specifies a file relative to a location on your computer This is pretty annoying when you move files around on your computer, or worse, try to share your code with other people.

  • Days 22-23: Meddling in the affairs of wizards   19 May 2018
    For the longest time I have been terrified of working with some of the low level features of R. So very often I would have been digging around by myself in the documentation - back when I started I don’t think there was an #rstats twitter community, I didn’t have anyone else around me using R, and I found the R mailing lists pretty intimidating because, well, a lot of the comments felt, um, slightly less than welcoming shall we say?

  • Days 20-21: Cat GIFs. Irises. Magick   17 May 2018
    In which the author adds a cat gif to a dull plot.

  • Days 18-19: Reference management in R   15 May 2018
    In this post I play around with reference managers for R. LaTeX has a very nice system for managing references (BibTeX), given that the citation() function in R already supplies BibTeX entries it would be nice to have a clean way to integrate this into an R Markdown document. The RefManageR package allows you to do this in a not-completely-painful fashion.

  • Days 16-17: Purrr-fection in film: The Princess Bride   13 May 2018
    Since the invention of the film, there have been five films that were rated the most passionate, the most pure. The Princess Bride left them all behind. So it is only appropriate that this post on functional programming takes only the most purrr-fect of films as input.

  • Day 15: Mathematical art   11 May 2018
    The problem with having resolved to write about a package every day, besides the fact that it’s a lot of work (but fun too!) is that life gets in the way. I deliberately picked a gap in my teaching schedule to try this, and there’s no way I’d have even considered it before both kids were of school age. I’m most definitely not living from the back of a RAV4, solo parenting, selling a house, and trying to organise a move across the country. Even so…

  • Day 14: Gauss can one-theorem numbers   10 May 2018
    I did not sleep well last night, and I am still getting over some mysterious illness. So this is a short post. The gaussfacts package prints out very true facts about Carl Friedrich Gauss, sourced from the canonical source This post is absurd.

  • Day 13: Sometimes I doubt my commitment to sparklines   09 May 2018
    The children are in bed. I am browsing the gallery of htmlwidgets. There is a sparkline widget. Sparklines look cute. I don’t know what I would use them for. I install it anyway. I load it. I make sparkline plots and then have an annoying time trying to blog about them.

  • Day 12: A first look at Stan   08 May 2018
    A colleague comes in with a statistics question. It doesn’t seem particularly unreasonable, and after a bit of thought it’s not too hard to come up with a model that would make sense for the problem. The only difficulty is that it’s non standard and I’d like to do it right rather than cut corners. It’s in this situation where probabilistic programming languages like BUGS, JAGS and Stan come in handy.

  • Day 11: Strings and substitutions   07 May 2018
    I am not well today. The only thing that has given me joy all day is the realisation that yes, Dani, there is a janeaustenr package, and I can use it to explore text processing with stringr in R.

  • Day 10: Exploring folklore Thursday using rtweet   06 May 2018
    I have several colleagues and friends who use social media as a data source, and I’ve always wondered how I could do this using R. The Twitter API, for instance, allows you some limited access to tweets, and in the past I have played around with the twitteR package to set up an R based twitter client. The rtweet package seems to be a slightly more recent version of the same thing.

  • Day 9: The LSR package has some deficiencies   05 May 2018
    The lsr package is one that I’m very familiar with, having written it to accompany my introductory stats lecture notes Learning Statistics with R. There are a lot of things I like about the motivation for the package, and almost nothing I like about the execution.

  • Day 8: Set default to prettiness   04 May 2018
    The default package is pretty simple. It allows you to check the default arguments to a function, to change those defaults if you like, and reset them. I am not sure I should be entrusted with this power

  • Day 7: Memes are valid social commentary   03 May 2018
    In which the author again takes herself very seriously.

  • Day 6: Lubridate   02 May 2018
    Working with times and dates is tricky for all kinds of reasons, not least of which because dates are fundamentally absurd. The lubridate package makes that slightly less painful.

  • Day 5: Leaflet   01 May 2018
    The leaflet package lets you draw awesome interactive maps. I think that for today’s learning exercise I’ll follow along with the tutorial on the RStudio website, but maybe take a few excursions as I go and draw some maps of Sydney.

  • Day 4: Magrittr is a series of tubes   30 Apr 2018
    Yesterday was supposed to be laundry day. I had a massive backlog of clothes that needed to be washed, another pile that needed folding, and several free hours in which I could put several loads through the washing machine. It didn’t quite go to plan.

  • Day 3: Watery deep learning with H2O   29 Apr 2018
    Maybe I should try playing around with deep learning? All the cool kids are doing it. A blog post in which I try to do something interesting but mostly fight with Java.

  • Day 2: This is serious, mum - the emo package   28 Apr 2018
    Yesterday’s effort with blogdown has worn me down. I cannot handle another one of those. Plus, my five year old daughter wants to play a game with me. Time to kill two birds with one stone, by exploring… THE EMO PACKAGE!!! Okay! I am excited. This looks like 🎉. It looks like 🎂 and like 🎈. I feel like 💃. I take a quick look at some of the documentation, install the package from the github repository…

  • Day 1: Getting started with blogdown   27 Apr 2018
    On the one hand I feel pretty foolish choosing the blogdown package as the place to start. As awesome as it sounds to have an R package that lets me write blog posts as R Markdown documents and knits everything to a nice neat static website that I can push online, I am a little intimidated by the complexity of the beast.

  • A random walk on CRAN   27 Apr 2018
    One of my goals this year was to broaden my horizons, programming-wise. In this post I proclaim my intention to explore a new R package each day and write a blog post. It is partially successful.