View source: R/do_sub_lineup.R
| do_sub_lineup | R Documentation |
Compute all the sub-lineups that a given team shows during a game. They can be made up of four, three, two or one player(s).
do_sub_lineup(data, elem_choose, col_diff_points = FALSE)
data |
Data frame with the lineups (quintets). |
elem_choose |
Numeric: 4, 3, 2 or 1. |
col_diff_points |
Logical to indicate if |
Data frame. Each row is a different sub-lineup. This is the meaning of the columns that might not be explanatory by themselves:
team_in: Time point when the sub-lineup starts playing together. team_out: Time point when the sub-lineup stops playing together (because there is a substitution). time_seconds: Total of seconds that the sub-lineup played.
A possession lasts 24 seconds in the ACB league.
Guillermo Vinue
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)
acb_games_2223_sl <- acb_vbc_cz_sl_2223 %>%
filter(period == "1C")
df1 <- do_prepare_data(df0, day_num,
acb_games_2223_sl, acb_games_2223_info,
game_code)
df2 <- do_lineup(df1, day_num, game_code, "Valencia Basket", FALSE)
df3 <- do_sub_lineup(df2, 4)
#df3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.