Learn R Programming

aRbs (version 0.1.2)

get_arbs: Find Arbitrage Opportunities

Description

Input a sport homepage URL as a string and return a list of arbitrage information. This will also print dataframes with details of the arbitrage opportunities, including the stake required for equal returns, the value of said equal returns, along with the relevant bookie for each outcome.

Usage

get_arbs(
  event = "https://www.oddschecker.com/football",
  in_play = FALSE,
  print_urls = FALSE,
  parallel = TRUE,
  debug = FALSE
)

Arguments

event

A URL to a www.oddschecker.com sport homepage, given as a string.

in_play

Logical. Should in-play arbitrage opportunities (arbs) also be returned? These are not likely to be accurate arbs as some bookie's odds will not be up-to-date, therefore default is FALSE.

print_urls

Logical. Should the URL of the event(s) be printed to the console while searching for arbitrage opportunities? Passed to get_arb_single.

parallel

Logical. Should iterative calls to get_arb_single be made in parallel.

debug

Logical. If set to TRUE, print_urls will be turned on and parallel will be turned off (so that URLs can be printed continuously).

Value

A list, with arbitrage information printed as series of dataframes.

Details

The workhorse function, clearly, is get_arb_single, however get_arbs implements it iteratively, after scraping and cleaning the required inputs for each distinct call to get_arb_single. This includes finding all the sub-URLs of the homepage. A progress bar is also used as the runtime is significant.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
get_arbs()
get_arbs("https://www.oddschecker.com/football") # equivalent to get_arbs()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab