View source: R/do_study_lineup.R
| do_study_lineup | R Documentation |
This is an improvement of do_lineup to obtain all the
information related to the lineups that a given team shows during a game.
do_study_lineup(data, day_num, game_code_num, team_sel, season = "2025-2026", verbose)
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. |
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.
A possession lasts 24 seconds in the ACB league.
Guillermo Vinue
do_lineup, do_possession,
do_lineup_metrics, do_usage
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.