helper that loads multiple seasons from the data repo either into memory or writes it into a db using some forwarded arguments in the dots
Usage
load_mbb_pbp(
seasons = most_recent_mbb_season(),
...,
dbConnection = NULL,
tablename = NULL
)
Arguments
- seasons
A vector of 4-digit years associated with given men's college basketball seasons. (Min: 2006)
- ...
Additional arguments passed to an underlying function that writes the season data into a database (used by
update_mbb_db()
).- dbConnection
A
DBIConnection
object, as returned by- tablename
The name of the play by play data table within the database
Value
Returns a tibble
col_name | types |
id | numeric |
sequence_number | character |
type_id | character |
type_text | character |
text | character |
away_score | integer |
home_score | integer |
period_number | integer |
period_display_value | character |
clock_display_value | character |
scoring_play | logical |
score_value | integer |
team_id | character |
participants_0_athlete_id | character |
wallclock | character |
shooting_play | logical |
participants_1_athlete_id | character |
season | integer |
season_type | integer |
away_team_id | integer |
away_team_name | character |
away_team_mascot | character |
away_team_abbrev | character |
away_team_name_alt | character |
home_team_id | integer |
home_team_name | character |
home_team_mascot | character |
home_team_abbrev | character |
home_team_name_alt | character |
home_team_spread | numeric |
game_spread | numeric |
home_favorite | logical |
game_spread_available | logical |
game_id | integer |
qtr | integer |
time | character |
clock_minutes | character |
clock_seconds | character |
half | character |
game_half | character |
lag_qtr | numeric |
lead_qtr | numeric |
lag_game_half | character |
lead_game_half | character |
start_quarter_seconds_remaining | integer |
start_half_seconds_remaining | integer |
start_game_seconds_remaining | integer |
game_play_number | integer |
end_quarter_seconds_remaining | numeric |
end_half_seconds_remaining | numeric |
end_game_seconds_remaining | numeric |
period | integer |
coordinate_x | integer |
coordinate_y | integer |
media_id | character |
See also
Other hoopR Loader Functions:
load_mbb_player_box()
,
load_mbb_schedule()
,
load_mbb_team_box()
,
load_nba_pbp()
,
load_nba_player_box()
,
load_nba_schedule()
,
load_nba_team_box()
Examples
# \donttest{
load_mbb_pbp(seasons = most_recent_mbb_season())
#> ── ESPN MBB Play-by-Play from hoopR data repository ───────────── hoopR 2.1.0 ──
#> ℹ Data updated: 2023-11-28 11:07:16 UTC
#> # A tibble: 407,751 × 56
#> game_play_number id sequence_number type_id type_text text away_score
#> <int> <dbl> <int> <int> <chr> <chr> <int>
#> 1 1 4.02e17 101807001 558 JumpShot Tris… 0
#> 2 2 4.02e17 101807301 587 Defensive … Trey… 0
#> 3 3 4.02e17 101809001 558 JumpShot Clar… 2
#> 4 4 4.02e17 101815301 574 DunkShot Dono… 2
#> 5 5 4.02e17 101817501 558 JumpShot Trey… 2
#> 6 6 4.02e17 101817701 587 Defensive … Tris… 2
#> 7 7 4.02e17 101818201 558 JumpShot Dono… 2
#> 8 8 4.02e17 101819901 598 Lost Ball … Clar… 2
#> 9 9 4.02e17 101819902 607 Steal Cam … 2
#> 10 10 4.02e17 101825301 572 LayUpShot Alex… 2
#> # ℹ 407,741 more rows
#> # ℹ 49 more variables: home_score <int>, period_number <int>,
#> # period_display_value <chr>, clock_display_value <chr>, scoring_play <lgl>,
#> # score_value <int>, team_id <int>, athlete_id_1 <int>, wallclock <chr>,
#> # shooting_play <lgl>, game_id <int>, season <int>, season_type <int>,
#> # home_team_id <int>, home_team_name <chr>, home_team_mascot <chr>,
#> # home_team_abbrev <chr>, home_team_name_alt <chr>, away_team_id <int>, …
# }