Description Usage Arguments Value Examples
partialMatch
converts betting odds from fraction to decimal. By
default, Oddschecker provides odds as fractions, while the exchange utilise
decimal odds. To allow easier comparision, we need to convert the fractional
odds to decimal. The function also returns negative under specific scenarios
(e.g. no odds).
1 | fracToDec(price)
|
price |
String. A string representing the odds of a bet, expressed in fractional form (e.g. 5/4). |
The output of the function is a numeric. In the event of "SP", 0.0 is returned, while "" is conveted -1.0.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# 2.25 is the decimal form of "5/4"
fracToDec("5/4")
# We can map a vector of fractional odds to their decimal form equivalent
sapply(c("5/4","8/11","4/6","5","22/2"),fracToDec)
# Finally, sometimes the odds are not provided, or at least not in fractional form.
To account for this, specific numbers are returned.
sapply(c("EVS","SP",""),fracToDec)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.