RcappeR

Converts margins, between the winner of a race and the horses behind, from lengths into seconds

Usage

conv_margins(btn_l, cum_l = TRUE, win_time = NULL, conditions = NULL)

Arguments

param details
btn_l beaten lengths (numeric)
cum_l indicates whether btn_l is cumulative, default TRUE
win_time winners time, optional param, if entered the function returns individual times for each runner
conditions race conditions that influence the BHA lengths per second scale to be used

Details

As default, the lengths per second scale used is the US convention of 5 lengths per second. However, if the race was run under the jurisdiciton of the BHA, then entering an abbreviation of the races’ conditions will apply the lengths per second scale employed by the BHA. See also bha_ls and bhascale

Example Use

btn_l <- c(0, 0.2, 0.5, 1, 1.5)

conv_margins(btn_l = btn_l)
## [1] 0.00 0.04 0.10 0.20 0.30
conv_margins(btn_l = btn_l, cum_l = FALSE)
## [1] 0.00 0.04 0.14 0.34 0.64
conv_margins(btn_l = btn_l, win_time = 59)
## [1] 59.00 59.04 59.10 59.20 59.30
conv_margins(btn_l = btn_l, win_time = 59, conditions = "f-gq")
## [1] 59.00 59.03 59.08 59.17 59.25