Skip to contents

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_team_box(
  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: 2003)

...

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_nametypes
team_idcharacter
team_uidcharacter
team_slugcharacter
team_locationcharacter
team_namecharacter
team_abbreviationcharacter
team_display_namecharacter
team_short_display_namecharacter
team_colorcharacter
team_alternate_colorcharacter
team_logocharacter
field_goals_made_field_goals_attemptedcharacter
field_goal_pctcharacter
three_point_field_goals_made_three_point_field_goals_attemptedcharacter
three_point_field_goal_pctcharacter
free_throws_made_free_throws_attemptedcharacter
free_throw_pctcharacter
total_reboundscharacter
offensive_reboundscharacter
defensive_reboundscharacter
assistscharacter
stealscharacter
blockscharacter
turnoverscharacter
team_turnoverscharacter
total_turnoverscharacter
technical_foulscharacter
total_technical_foulscharacter
flagrant_foulscharacter
foulscharacter
largest_leadcharacter
home_awaycharacter
opponent_idinteger
opponent_namecharacter
opponent_mascotcharacter
opponent_abbrevcharacter
game_idinteger
seasoninteger
season_typeinteger
game_dateDate

Examples

# \donttest{
load_mbb_team_box(seasons = most_recent_mbb_season())
#> ── ESPN MBB Team Boxscores from hoopR data repository ─────────── hoopR 3.0.0 ──
#>  Data updated: 2026-03-26 11:39:16 UTC
#> # A tibble: 12,458 × 59
#>      game_id season season_type game_date  game_date_time      team_id team_uid 
#>        <int>  <int>       <int> <date>     <dttm>                <int> <chr>    
#>  1 401858360   2026           3 2026-03-25 2026-03-25 21:00:00    2440 s:40~l:4…
#>  2 401858360   2026           3 2026-03-25 2026-03-25 21:00:00       2 s:40~l:4…
#>  3 401858359   2026           3 2026-03-25 2026-03-25 19:00:00    2287 s:40~l:4…
#>  4 401858359   2026           3 2026-03-25 2026-03-25 19:00:00    2168 s:40~l:4…
#>  5 401858358   2026           3 2026-03-24 2026-03-24 21:00:00    2603 s:40~l:4…
#>  6 401858358   2026           3 2026-03-24 2026-03-24 21:00:00     167 s:40~l:4…
#>  7 401858357   2026           3 2026-03-24 2026-03-24 19:00:00    2724 s:40~l:4…
#>  8 401858357   2026           3 2026-03-24 2026-03-24 19:00:00     202 s:40~l:4…
#>  9 401856560   2026           3 2026-03-22 2026-03-22 22:08:00    2641 s:40~l:4…
#> 10 401856560   2026           3 2026-03-22 2026-03-22 22:08:00     333 s:40~l:4…
#> # ℹ 12,448 more rows
#> # ℹ 52 more variables: team_slug <chr>, team_location <chr>, team_name <chr>,
#> #   team_abbreviation <chr>, team_display_name <chr>,
#> #   team_short_display_name <chr>, team_color <chr>,
#> #   team_alternate_color <chr>, team_logo <chr>, team_home_away <chr>,
#> #   team_score <int>, team_winner <lgl>, assists <int>, blocks <int>,
#> #   defensive_rebounds <int>, fast_break_points <chr>, field_goal_pct <dbl>, …
# }