The collection of functions range from the very simple, cleaning tasks that could be required regularly, to the more complex handicapping functions.
The four sections below split the functions into groups, but it is more likely that the functions will be used one after another as horse racing data is cleaned and prepared ahead of handicapping.
Cleaning functions attempt to, surprise, surprise, clean racing data, from racing times, to weight, see the Data Cleaning vignette to see a few of them in use.
function | what’s it for | help |
---|---|---|
conv_times | converts times in character format (such as “1m39.99”) into a time in seconds | help |
conv_margins | converts margins between horses from lengths into seconds | help |
conv_wgt | converts weights from character format of stones-lbs, or from numeric format from kg to lbs | help |
conv_len | converts lengths from character format, such as “1 3/4” or “nse”, into numeric format | help |
Preparation functions aim to prepare data for either handicapping or further analysis, see the Data Preparation and zipf_race vignettes to see a few of these functions in use.
function | what’s it for | help |
---|---|---|
btn_sec | calculates the margin (in seconds) between horses | help |
fin_spd | calculates finishing speed percentages using sectionals | help |
fin_sect | calculates finishing sectionals using finishing speeds | help |
lbs_per_sec | lbs per second scale | help |
rnrs_btn | calculates percentage of runners beaten | help |
bha_ls | returns BHA lengths per second scale | help |
These functions typically require a number of the functions above to be used, to get data into a format that the functions below can deal with.
function | what’s it for | help |
---|---|---|
diff_at_wgts | calculates the difference at the weights | help |
zipf_race | handicaps a single race using one race | help |
zipf_hcp | handicaps a single race using many races | help |
zipf_init | initialises a handicap using many races | help |
These functions provide assistance for potential tasks.
function | what’s it for | help |
---|---|---|
theme_rcapper | a custom ggplot theme | help |
mean_rating | helper function to be used as a parameter in the boot function from the boot package |
help |
merge_zipf_init | merges list returned by zipf_init and the dataframe entered into that function | help |