Skip to contents

Get NBA win probability chart data from ESPN

Usage

espn_nba_wp(game_id)

Arguments

game_id

(Integer required): Game ID filter for querying a single game

Value

espn_nba_wp() - A data frame with 21 variables:

col_nametypes
game_idnumeric
play_idcharacter
home_win_percentagenumeric
away_win_percentagenumeric
tie_percentagenumeric
sequence_numbercharacter
textcharacter
away_scoreinteger
home_scoreinteger
scoring_playlogical
score_valueinteger
participantslist
shooting_playlogical
type_idcharacter
type_textcharacter
period_numberinteger
period_display_valuecharacter
clock_display_valuecharacter
team_idcharacter
coordinate_xinteger
coordinate_yinteger

Examples

# \donttest{
  espn_nba_wp(game_id = 401283399)
#> ── ESPN NBA Win Probability Information from ESPN.com ─────────── hoopR 2.1.0 ──
#>  Data updated: 2023-11-28 22:10:08 UTC
#> # A tibble: 472 × 22
#>      game_id play_id     home_win_percentage away_win_percentage tie_percentage
#>        <dbl> <chr>                     <dbl>               <dbl>          <dbl>
#>  1 401283399 4012833994                0.615               0.385              0
#>  2 401283399 4012833997                0.6                 0.4                0
#>  3 401283399 4012833998                0.595               0.405              0
#>  4 401283399 4012833999                0.594               0.406              0
#>  5 401283399 40128339911               0.61                0.39               0
#>  6 401283399 40128339912               0.615               0.385              0
#>  7 401283399 40128339913               0.599               0.401              0
#>  8 401283399 40128339914               0.593               0.407              0
#>  9 401283399 40128339915               0.54                0.46               0
#> 10 401283399 40128339916               0.577               0.423              0
#> # ℹ 462 more rows
#> # ℹ 17 more variables: sequence_number <chr>, text <chr>, away_score <int>,
#> #   home_score <int>, scoring_play <lgl>, score_value <int>,
#> #   participants <list>, wallclock <chr>, shooting_play <lgl>, type_id <chr>,
#> #   type_text <chr>, period_number <int>, period_display_value <chr>,
#> #   clock_display_value <chr>, team_id <chr>, coordinate_x <int>,
#> #   coordinate_y <int>
# }