Learn R Programming

BAwiR (version 1.3.4)

do_prepare_data: Prepare ACB play-by-play data

Description

Prepare the ACB play-by-play data to be analyzed in further steps. It involves correcting some inconsistencies and filtering some unnecessary information.

Usage

do_prepare_data(data, day_num, data_gsl, data_ginfo, game_code_excel)

Value

Data frame. Each row represents the action happened in the game. It has associated a player, a time point and the game score. The team

column refers to the team to which the player belongs.

Arguments

data

Source play-by-play data from a given game.

day_num

Day number.

data_gsl

Games' starting lineups.

data_ginfo

Games' basic information.

game_code_excel

Game code.

Author

Guillermo Vinue

Examples

Run this code
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)
#df1                        

Run the code above in your browser using DataLab