Comments (3)
Howdy!
It's definitely possible, I'll be adding get_espn_win_prob()
and get_nfl_schedule()
functions shortly.
Here's the plotted output from get_espn_win_prob()
As far as I can tell you'd have to get this at the game level, but by combining get_nfl_schedule()
to get the game_id
which can be passed to get_espn_win_prob()
- returns a dataframe like below:
Rows: 185
Columns: 19
$ row_id <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, …
$ quarter <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ home_score <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
$ away_score <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7,…
$ distance <int> 0, 10, 10, 9, 10, 10, 4, 10, 6, 1, 10, 7, 7, 10, 5, 1, 0, 10, 5, 7, 10,…
$ yard_line <int> 35, 80, 69, 68, 55, 55, 49, 44, 40, 35, 33, 30, 30, 16, 5, 1, 65, 16, 2…
$ pos_team_id <chr> "12", "17", "17", "17", "17", "17", "17", "17", "17", "17", "17", "17",…
$ down <int> 0, 1, 1, 2, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 2, 0, 1, 2, 3, 1, 2, 3, 4,…
$ yards_to_endzone <int> 65, 80, 69, 68, 55, 55, 49, 44, 40, 35, 33, 30, 30, 16, 5, 1, 65, 84, 7…
$ short_down_distance_text <chr> NA, "1st & 10", "1st & 10", "2nd & 9", "1st & 10", "2nd & 10", "3rd & 4…
$ possession_text <chr> NA, "NE 20", "NE 31", "NE 32", "NE 45", "NE 45", "KC 49", "KC 44", "KC …
$ down_distance_text <chr> NA, "1st & 10 at NE 20", "1st & 10 at NE 31", "2nd & 9 at NE 32", "1st …
$ text <chr> "H.Butker kicks 70 yards from KC 35 to NE -5. C.Patterson to NE 20 for …
$ play_type <chr> "Kickoff", "Rush", "Rush", "Pass Reception", "Rush", "Pass Reception", …
$ overtime_play_count <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
$ home_win_percentage <dbl> 0.668, 0.654, 0.676, 0.639, 0.659, 0.649, 0.610, 0.623, 0.593, 0.582, 0…
$ play_id <chr> "40103885036", "40103885061", "40103885083", "401038850105", "401038850…
$ tie_percentage <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
$ seconds_left <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
from espnscraper.
Hi @cawthm - I've added get_espn_win_prob()
officially to the package, you just need to pass specific a game_id
. There's also only win prob for past few years, so you will get errors prior to 2016.
espnscrapeR::get_espn_win_prob(game_id = "401030956") %>% glimpse()
Rows: 160
Columns: 9
$ row_id <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,…
$ home_team_id <chr> "23", "23", "23", "23", "23", …
$ away_team_id <chr> "17", "17", "17", "17", "17", …
$ tie_percentage <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
$ home_win_percentage <dbl> 0.599, 0.605, 0.597, 0.592, 0.…
$ away_win_percentage <dbl> 0.401, 0.395, 0.403, 0.408, 0.…
$ sequence_number <chr> "100", "3600", "5100", "7700",…
$ play_id <chr> "4010309561", "40103095636", "…
$ game_id <chr> "401030956", "401030956", "401…
from espnscraper.
Super interesting. Thank you for this package and for your work on modeling generally.
from espnscraper.
Related Issues (20)
- Wrong team in ESPN API? HOT 4
- get_nfl_boxscore_players(game_id = "401220131") HOT 4
- Connection Error HOT 2
- get_nfl_teams() Error 403 HOT 3
- get_college_qbr() only pulling 2020 data HOT 6
- get_athlete() Error: Not Found (HTTP 404) HOT 1
- List of Player ID's HOT 1
- Some boxscores do not appear HOT 1
- 2022 Pass Win Rates Update HOT 2
- Error in player name for players on multiple teams throughout the year HOT 1
- Installation Assistance HOT 1
- `scrape_team_stats_nfl` gives error when `role="defense"` HOT 2
- Defense type in scrape_espn_stats() HOT 1
- Add 2023 win rates? HOT 2
- ESPN Data inconsistent HOT 3
- Unable to pull 2020 College QBR HOT 2
- Two stray commas causing get_nfl_schedule to fail HOT 1
- College QBR Data missing HOT 6
- keep venue in get_schedule_data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espnscraper.