Description Usage Arguments Details Examples
Convert race times into more workable format. Most Horse Racing times are run in minutes, so times this function works on will be recorded as 'minutes:seconds:milliseconds' and 'seconds:milliseconds', which will be converted into seconds:milliseconds.
1 | conv_times(times, regex = NULL)
|
times |
times to be converted |
regex |
specific regular expression to split times by (if function doesn't cater for the times entered) |
Takes a character string representing a race time, splits it up according to a regular expression that looks for punctuation, a space or the letter 'm' (full regex = "[[:punct:]]\s?|\s?[[:alpha:]]\s?|\s+"), so times like '1m39.99', '1 39.99' or '1.39.99' are split into '1', '39' and '99', it then recombines to return a numeric time in seconds. If there are any race times that this doesn't cater for then use the regex param to enter a specific regular expression to split the times by.
1 2 3 4 5 | ## Not run:
times <- c("1.39.99", "1m39.99", "1 39.99")
conv_times(times = times)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.