R Packages

I have built and shared six R packages, all listed below, and all available on github for others to use, contribute to, adapt.


An R package which provides access to Betfair’s API, and allows users to retrieve data (in various amounts of detail) from available markets, to place a bet within those markets, cancel bets, replace bets, etc.

It also provides functionality to access your account and manage funds between wallets, plotting you P/L over time, and retrieve all current live bets.

There are help pages available, found here


A collection of tools to aid the analysis and handicapping of Thoroughbred Horse Racing. A number of tools help with grunt work, cleaning and preparing data for the more complicated tools. These cleaning tools include converting margins from lengths into seconds, converting character string times into numeric times, etc. The more complicated tools help with handicapping the races, by using race standardisation.

There are help pages available, found here.


Collection of functions to simulate a tennis point, game, set, tiebreak and match.

There are help pages available, found here.


R package with datasets and functions for the fantasy football game fantasy.premierleague.com.

There are help pages available, found here


R package with variety of datasets from Thoroughbred Bloodstock Sales, at the time of writing there are 6 datasets of Tattersalls sales from 2010 to 2015 (incomplete).

I recommend checking out the pinhooker R package which is along similar lines but contains a lot more data from other sales, and appears to be updated with more regularity.

There are help pages available, found here.


This package isn’t under active development.

The calheatmapR package is an R interface for the cal-heatmap Javascript charting library, which is used to

create calendar heatmaps to help visualise time series data, a la github contribution graph

The package owes everything to the creators of the R package htmlwidgets (repo), Ramnath Vaidyanathan and JJ Alaire, as well as the RStudio team. And to @timelyportfolio who has created a huge amount of htmlwidgets, be sure to check out his site buildingwidgets. This is my first htmlwidget package and at the moment it is a bit limited and doesn’t replicate everything that the Javascript library does.

There are help pages available, found here