RcappeR

A collection of tools to aid the analysis and handicapping of Thoroughbred Horse Racing.

The package includes various functions to help with the cleaning and preparation of racing data, such as cleaning times, converting and calculating margins between horses. See Functions for a list of functions and links to their pages, and the vignettes Data Cleaning and Data Preparation that show a number of these functions being applied.

Those functions help prepare data for the handicapping of a collection of races, for which there are a number of functions, such as calculating a lbs per second scale, difference at the weights, before calculating ratings using race standardisation and zipf’s law. See under the heading Handicapping on the Functions page for a list of functions, and the vignettes showing the use of Handicapping using zipf_race, Handicapping using zipf_hcp and Initialising a Handicap in creating ratings.

The package also contains a few datasets to show how to use the functions, though the functions should be quite flexible, performing useful tasks. The datasets include the lengths per second scale the BHA employ in calculating margins between horses (see bhascale), a couple of example races to show the cleaning functions (see example_race), and a dataset of races run at Gulfstream Park in the US (see gulfstream)

There is a blog post looking at wild horse racing data, see that here.