Learn R Programming

BAwiR (version 1.5)

do_study_lineup: Compute lineups with their statistics

Description

This is an improvement of do_lineup to obtain all the information related to the lineups that a given team shows during a game.

Usage

do_study_lineup(data, day_num, game_code_num, team_sel, season = "2025-2026", verbose)

Value

A list with four data frames:

  • data_lin: Statistics obtained by every lineup. data_pos: Start of each possession. data_usg: Possessions ended by each player. data_usg_act: Actions that ended each possession per player.

Arguments

data

Play-by-play prepared data from a given game.

day_num

Day number.

game_code_num

Game code.

team_sel

One of the teams involved in the game.

season

Season string.

verbose

Logical to indicate if the information of the computations must be provided.

Author

Guillermo Vinue

See Also

do_lineup, do_possession, do_lineup_metrics, do_usage

Examples

Run this code
if (FALSE) {
library(dplyr)
df0 <- acb_vbc_cz_pbp_2223

day_num <- unique(acb_vbc_cz_pbp_2223$day)
game_code <- unique(acb_vbc_cz_pbp_2223$game_code)

# Starting players:
acb_games_2223_sl <- acb_vbc_cz_sl_2223 %>%
  dplyr::filter(period == "1C")

# Prepare data:
df1 <- do_prepare_data(df0, day_num, 
                       acb_games_2223_sl, acb_games_2223_info,
                       game_code)

teams_game <- sort(unique(df1$team))

# Study the lineups:
data_res <- do_study_lineup(df1, day_num, game_code, teams_game[1], "2022-2023", FALSE) 
}

Run the code above in your browser using DataLab