Learn R Programming

hoopR (version 3.1.0)

cbbd_substitutions_game: CBD Substitutions by Game

Description

Get substitution data for a single game from the CollegeBasketballData API.

Get substitution data for a single player from the CollegeBasketballData API.

Get substitution data for a team-season from the CollegeBasketballData API.

Usage

cbbd_substitutions_game(game_id)

cbbd_substitutions_player(player_id, season = most_recent_mbb_season())

cbbd_substitutions_team(season = most_recent_mbb_season(), team)

Value

A hoopR_data tibble with one row per substitution. sub_in and sub_out objects are flattened to sub_in_* / sub_out_* columns:

col_nametypesdescription
game_idintegerGame id.
start_datecharacterGame start date (ISO 8601).
team_idintegerTeam id.
teamcharacterTeam name.
conferencecharacterTeam conference.
athlete_idintegerAthlete id.
athletecharacterAthlete name.
positioncharacterAthlete position.
opponent_idintegerOpponent team id.
opponentcharacterOpponent team name.
opponent_conferencecharacterOpponent conference.

A hoopR_data tibble with one row per substitution (same columns as cbbd_substitutions_game()).

A hoopR_data tibble with one row per substitution (same columns as cbbd_substitutions_game()).

Arguments

game_id

(integer required): CollegeBasketballData game id. See cbbd_games().

player_id

(integer required): Athlete id.

season

(integer required): Season, 4-digit ending-year (e.g. 2024). Defaults to most_recent_mbb_season().

team

(character required): Team name (e.g. Duke).

Examples

Run this code
# \donttest{
  try(cbbd_substitutions_game(game_id = 5881))
# }
# \donttest{
  try(cbbd_substitutions_player(player_id = 160, season = 2024))
# }
# \donttest{
  try(cbbd_substitutions_team(season = 2024, team = "Duke"))
# }

Run the code above in your browser using DataLab