Check out R-bloggers for more excellent content!

What's New in R 3.5.0?

2018-07-09     R

A complete list of the changes in R 3.5.0 can be found here. I’m picking out two (personal) highlights here. Read more »

Updating R on Ubuntu

2018-07-09     R

Today I finally got around to updating my R to 3.5 (or, more specifically, 3.5.1). The complete instructions for doing the update on Ubuntu are available here. I’ve paraphrased them below. Read more »

eRum (2018) Top Twenty

2018-05-18     R conference

My Top 20 highlights about eRum (2018) in Budapest. In no particular order: Read more »

Travelling Salesman with ggmap

2018-05-10     R

I’ve been testing out some ideas around the Travelling Salesman Problem using TSP and ggmap. For illustration I’ll find the optimal route between the following addresses: Read more »

Classification: Get the Balance Right

2018-04-21     R machine learning

For classification problems the positive class (which is what you’re normally trying to predict) is often sparsely represented in the data. Unless you do something to address this imbalance then your classifier is likely to be rather underwhelming. Achieving a reasonable balance in the proportions of the target classes is seldom emphasised. Perhaps it’s not very sexy. But it can have a massive effect on a model. Read more »

Workshop: Web Scraping with R

2018-04-12     talk: training talk: workshop

Join Andrew Collier and Hanjo Odendaal for a workshop on using R for Web Scraping. Read more »

Tips for Lightning Talks

2018-04-06     Speaking R

It seems a little counter-intuitive, but a 5 minute lightning talk is far more difficult to prepare (and present!) than a standard 20 minute or longer talk. The principle challenge is fitting everything that you want to say into the allotted time, while still maintaining an engaging narrative. At the recent satRday conference in Cape Town (17 March 2018) we had a number of great lightning talks. A few of the speakers gave us their tips on creating a brilliant lightning talk. Read more »

Restoring a Django Backup

2018-02-23     Django

It took me a little while to figure out the correct sequence for restoring a Django backup. If you have borked your database, this is how to put it back together. Read more »

Extending DataGrip Evaluation

2018-02-16     SQL Linux

DataGrip is a great tool for accessing a wide range of databases. You can get a free 30 day evaluation license. But perhaps you want to evaluate for a tiny bit longer? Read more »

Installing DataGrip on Ubuntu

2018-02-16     SQL Linux

Download the DataGrip archive. Unpack the archive. $ tar -zxvf datagrip-2018.1.4.tar.gz Rename the folder. $ mv DataGrip-2018.1.4/ datagrip Change the owner to root. $ chown -R root.root datagrip Move to /opt. $ sudo mv datagrip /opt/ Link it into PATH. $ sudo ln -s /opt/datagrip/bin/ /usr/local/bin/datagrip Start it from the terminal. $ datagrip

SQL Server from Ubuntu

2018-02-05     SQL Linux

Setting up the requisites to access a SQL Server database from Ubuntu. Read more »

Installing rJava on Ubuntu

2018-02-05     R Linux

Installing the rJava package on Ubuntu is not quite as simple as most other R packages. Some quick notes on how to do it. Read more »

Linux VM on Azure

2018-02-05     Azure Linux

A quick tutorial on how to create a Linux VM on Azure. Read more »

Ethereum: DIY Tools for Smart Contracts

2018-01-19     Ethereum

What tools do you need to start working with Ethereum smart contracts? The Solidity Online Compiler provides a quick way to experiment with smart contracts without installing any software on your machine. Another promising online alternative is Cosmo. However at some stage you’ll probably want to put together a local Ethereum development environment. Here are some suggestions for how to do that on an Ubuntu machine. Since I’m just feeling my way into this new domain, I’m not sure to what degree all of these are necessary. I do know for sure, that Truffle and testrpc are crucial. Read more »

Ethereum: Running a Node

2018-01-19     Ethereum

Once you’ve installed Geth you’re ready to run your own Ethereum node. Read more »

NTP: Synchronise Your Watches

2018-01-11     NTP

Just like an old fashioned grandfather clock, time time on your computer’s clock can slowly drift. You can quickly verify the accuracy of your clock by comparing it to It’s not unusual for it to be anything from a few seconds to a couple of minutes out. For most purposes this is not a major issue, but there are some applications which are very time sensitive. NTP (Network Time Protocol) is a tool which will synchronise your computer’s clock with a network of accurate time servers, ensuring that it’s always accurate. There’s a lot to be said about NTP, but this is a quick guide to getting it up and running on an Ubuntu machine. Read more »

An Ethereum Package for R

2018-01-07     Ethereum

Bitcoin has become synonymous with “cryptocurrency”. Ethereum is another cryptocurrency which, although not as hyped at Bitcoin, presents some attractive characteristics. The foremost of these is the ability to create sophisticated smart contracts. This post introduces the new ether package for interacting with the Ethereum network from R. Read more »

Moving a Running Process to screen

2017-12-30     Linux

I am not sure how many times this has happened to me, but it’s not infrequent. I’m working on a remote session and I start a long running job. Then some time later I want to disconnect from the session but realise that if I do then the job will be killed. I should have started job in screen or tmux! So, is it possible to transfer the running process to screen? (Or, equally, to tmux?) Well it turns out that it is using the reptyr utility. I discovered this thanks to a LinkedIn post by Bruce Werdschinski. A slightly refinement of his process is documented below. Read more »

Creating an Amazon Machine Image

2017-12-04     AWS

Creating an Amazon Machine Image (AMI) makes it quick and simple to rebuild a specific EC2 setup. This post illustrates the process by creating an AMI with ethminer and NVIDIA GPU drivers. Of course you’d never use this for mining Ether because the hardware costs are still too high! Read more »

Using Large Maps with OSRM

2017-11-27     OSRM

How to deal with large data sets in OSRM? Some quick notes on processing monster PBF files and getting them ready to serve with OSRM. Something to consider up front: if you are RAM limited then this process is going to take a very long time due to swapping. It might make sense to spin up a big clound instance (like a r4.8xlarge) for a couple of hours. You’ll get the job done much more quickly and it’ll definitely be worth it. Read more »

EC2 Missing Disk Space


This morning I created a r3.xlarge spot instance on EC2. The job I’m planning on running requires a good wad of data to be uploaded, which is why I chose the r3.xlarge instance: it’s cost effective and, according to AWS, has 80 Gb of SSD storage. So I was a little surprised when I connected to the running instance and found that the root partition was only around 8 Gb. This is what I did to claim that missing disk space. Read more »

Variable Names: Camel Case to Underscore Delimited

2017-11-20     R

A project I’m working on has a bunch of different data sources. Some of them have column names in Camel Case. Others are underscore delimited. My OCD rebels at this disarray and demands either one or the other. If it were just a few columns and I was only going to have to do this once, then I’d probably just quickly do it by hand. But there are many columns and it’s very likely that there’ll be more data in the future and the process will need to be repeated. Seems like something that should be easy to automate. Read more »

Analysis of Feedback from satRday [Cape Town] 2017

2017-11-15     R satRday Conference

We recently announced the second satRday (Cape Town) conference scheduled to take place on 17 March 2018. Obviously we want this to be bigger and better than this year’s event, so we are paying careful attention to the feedback that we received from the first event. This is a quick analysis of the feedback. We sold 192 tickets and gave out 11 complimentaries to the event. There were 107 responses to the feedback survey, which means that we heard back from more than half of the people who attended, which is hopefully a representative sample. Read more »

Durban Twitter Analysis

2017-11-10     R sentiment

I was invited to give a talk at Digifest (Durban University of Technology) on 10 November 2017. Looking at the other speakers and talks on the programme I realised that my normal range of topics would not be suitable. I needed to do something more in line with their mission to “celebrate the creative spirit through multimedia projects from disciplines such as visual and performing arts” and to promote “collaboration across art, science and technology”. Definitely outside my current domain, but consistent with many of the things that I have been aspiring to. To be honest, I was pleased to be invited, but when I sat down to consider what I would talk about, I found myself at a loss. I’m not currently engaged in anything that ticks many of those boxes. But I am loathe to turn down an opportunity to speak. So I made a plan. In retrospect it was not a terribly good plan. But it was workable. I decided to speak about gauging sentiment relating to the city of Durban using data from Twitter. This post touches on some of my results. Read more »

Speaking Bucket List

2017-10-21     Speaking

A list of conferences and meetups I’d like to speak at in the next few years. Read more »

Installing NVIDIA Graphics Driver on Ubuntu

2017-10-07     Linux GPU

Recipe for installing the NVIDIA binary drivers on Ubuntu. Read more »

Running OSRM with Docker

2017-10-07     Docker OSRM

I’ve now been through the process of setting up OSRM a few times. While it’s not exactly taxing, it seemed like a prime candidate for automation. Read more »

Exporting HTML Presentations to PDF

2017-10-05     Speaking

Building a presentation with reveal.js is such a pleasure. And the results looks so good. Seriously doubt that I will ever use anything like PowerPoint again. Although it’s possible to export a presentation directly to PDF using a style sheet, this doesn’t always work perfectly (IMHO). Fortunately there’s another way: decktape. It works with reveal.js and a bunch of other HTML5 presentation frameworks. Read more »

Quick Wordpress Install with Docker

2017-09-22     Docker Wordpress Linux MySQL

I’ve just put together a Wordpress site for my older daughter. It’s hosted on DigitalOcean and all of the infrastructure is handled with Docker. This post describes the steps in the (easy) install process. Read more »

Diagnosing Killed Jobs on EC2

2017-09-21     Linux AWS

I’ve got a long running optimisation problem on a EC2 instance. Yesterday it was mysteriously killed. I shrugged it off as an anomaly and restarted the job. However, this morning it was killed again. Definitely not a coincidence! So I investigated. This is what I found and how I am resolving the problem. Read more »