maksimhorowitz / nflscrapR

R Package for Scraping and Aggregating NFL Data
528 stars 138 forks source link

WP not being calculated #160

Closed bcarancibia closed 4 years ago

bcarancibia commented 4 years ago

When trying out the example code to plot kc_vs_pit_pbp I am getting a probability chart that is blank. Rplot

I took a look at the data columns and see that home_wp and away_mp are not being calculated and just show as NAs.

`> kc_vs_pit_pbp %>% select(game_seconds_remaining, home_wp, away_wp)

A tibble: 193 x 3

game_seconds_remaining home_wp away_wp

1 3600 NA NA 2 3597 NA NA 3 3591 NA NA 4 3569 NA NA 5 3562 NA NA 6 3548 NA NA 7 3513 NA NA 8 3490 NA NA 9 3485 NA NA 10 3485 NA NA # … with 183 more rows` I was able to replicate in a different week in 2018. `phi_vs_ind_pbp <- week_3_games %>% + filter(home_team == "PHI") %>% + pull(game_id) %>% + scrape_json_play_by_play() > phi_vs_ind_pbp %>% select(game_seconds_remaining, home_wp, away_wp) # A tibble: 190 x 3 game_seconds_remaining home_wp away_wp 1 3600 NA NA 2 3593 NA NA 3 3561 NA NA 4 3526 NA NA 5 3491 NA NA 6 3450. NA NA 7 3441 NA NA 8 3437 NA NA 9 3405 NA NA 10 3380 NA NA # … with 180 more rows`
ryurko commented 4 years ago

Thanks for pointing this out, this should now be addressed with the latest commit. Please re-install and let us know if any related issue persists.

bcarancibia commented 4 years ago

works with the update - thanks!