Skip to contents

Get ESPN men's college basketball PBP data

Usage

espn_mbb_pbp(game_id)

Arguments

game_id

Game ID

Value

A play-by-play data frame.

Plays

col_nametypes
idcharacter
sequence_numbercharacter
textcharacter
away_scoreinteger
home_scoreinteger
scoring_playlogical
score_valueinteger
wallclockcharacter
shooting_playlogical
type_idinteger
type_textcharacter
period_numberinteger
period_display_valuecharacter
clock_display_valuecharacter
team_idinteger
coordinate_x_rawnumeric
coordinate_y_rawnumeric
coordinate_xnumeric
coordinate_ynumeric
play_idcharacter
athlete_id_1integer
athlete_id_2integer
home_team_idinteger
home_team_mascotcharacter
home_team_namecharacter
home_team_abbrevcharacter
home_team_logocharacter
home_team_logo_darkcharacter
home_team_full_namecharacter
home_team_colorcharacter
home_team_alternate_colorcharacter
home_team_scoreinteger
home_team_winnerlogical
home_team_recordcharacter
away_team_idinteger
away_team_mascotcharacter
away_team_namecharacter
away_team_abbrevcharacter
away_team_logocharacter
away_team_logo_darkcharacter
away_team_full_namecharacter
away_team_colorcharacter
away_team_alternate_colorcharacter
away_team_scoreinteger
away_team_winnerlogical
away_team_recordcharacter
game_idinteger
seasoninteger
season_typeinteger
game_dateDate
game_date_timePOSIXct

Author

Saiem Gilani

Examples

# \donttest{
  try(espn_mbb_pbp(game_id = 401479672))
#> ── ESPN MBB Play-by-Play Information from ESPN.com ────────────── hoopR 2.1.0 ──
#>  Data updated: 2023-11-28 22:09:52 UTC
#> # A tibble: 360 × 51
#>    id       sequence_number text  away_score home_score scoring_play score_value
#>    <chr>    <chr>           <chr>      <int>      <int> <lgl>              <int>
#>  1 4014796… 101799901       Jump…          0          0 FALSE                  0
#>  2 4014796… 101805501       Jess…          0          0 FALSE                  2
#>  3 4014796… 101805502       RJ M…          0          0 FALSE                  0
#>  4 4014796… 101805503       Skyy…          0          0 FALSE                  0
#>  5 4014796… 101808101       Terr…          0          0 FALSE                  3
#>  6 4014796… 101808102       RJ M…          0          0 FALSE                  0
#>  7 4014796… 101809301       RJ M…          0          0 FALSE                  2
#>  8 4014796… 101809302       Benn…          0          0 FALSE                  0
#>  9 4014796… 101809501       Foul…          0          0 FALSE                  0
#> 10 4014796… 101814601       Juda…          0          0 FALSE                  2
#> # ℹ 350 more rows
#> # ℹ 44 more variables: wallclock <chr>, shooting_play <lgl>, type_id <int>,
#> #   type_text <chr>, period_number <int>, period_display_value <chr>,
#> #   clock_display_value <chr>, team_id <int>, coordinate_x_raw <dbl>,
#> #   coordinate_y_raw <dbl>, coordinate_x <dbl>, coordinate_y <dbl>,
#> #   play_id <chr>, athlete_id_1 <int>, athlete_id_2 <int>, home_team_id <int>,
#> #   home_team_mascot <chr>, home_team_name <chr>, home_team_abbrev <chr>, …
# }