Description Usage Format Details Examples
US Presidential Election data 2016.
1 |
A data.frame with 5 variables:
EnteredDateTime
Time of the wager line in UTC
TeamName1
Team name of the Away Team
TeamName2
Team name of the Home Team
MoneyUS1
Moneyline US odds for Away Team
MoneyUS2
Moneyline US odds for Home Team
All lines from Pinnacle for the 2016 US Presidential Election
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | if (require("odds.converter")) {
library(tidyverse)
# What is Hilary Clinton's the highest implied winning probability at Pinnacle?
USA_Election_2016[which.min(USA_Election_2016$MoneyUS1),"EnteredDateTime"]
odds.converter::odds.us2prob(min(USA_Election_2016$MoneyUS1))
}
# What time on election night that Trump's implied winning probability surpassed Clinton's?
if (require("tidyverse")) {
library(tidyverse)
USA_Election_2016 %>%
filter(MoneyUS1>MoneyUS2) %>%
slice(1)
}
|
Loading required package: tibble
Loading required package: odds.converter
-- Attaching packages --------------------------------------- tidyverse 1.2.1 --
v ggplot2 3.1.1 v purrr 0.3.2
v tidyr 0.8.3 v dplyr 0.8.0.1
v readr 1.3.1 v stringr 1.4.0
v ggplot2 3.1.1 v forcats 0.4.0
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
[1] 0.9389126
# A tibble: 1 x 5
EnteredDateTime TeamName1 TeamName2 MoneyUS1 MoneyUS2
<dttm> <chr> <chr> <dbl> <dbl>
1 2016-11-09 01:25:39 Hilary Clinton Donald Trump -101 -111
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.