Learn R Programming

BAwiR (version 1.3.4)

do_time_out_success: Check if timeouts resulted in scoring

Description

For each team, locate the position of timeouts and check if they resulted in scoring points.

Usage

do_time_out_success(data, day_num, game_code, team_sel, verbose)

Value

Data frame. This is the meaning of the columns:

  • day: Day number. game_code: Game code. team: Name of the corresponding team and coach. times_out_requested: Number of timeouts requested in the game. times_out_successful: Number of timeouts that resulted in scoring. times_out_successful_perc: Percentage of successful timeouts. points_scored: Total of points achieved after the timeouts.

Arguments

data

Prepared data from a given game.

day_num

Day number.

game_code

Game code.

team_sel

One of the teams' names involved in the game.

verbose

Logical. Decide if information of the computations must be provided or not.

Author

Guillermo Vinue

See Also

do_prepare_data_to

Examples

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

df1 <- do_prepare_data_to(df0, TRUE, acb_games_2223_info, acb_games_2223_coach)

# sort(unique(df1$team))
# "Casademont Zaragoza_Porfirio Fisac" "Valencia Basket_Alex Mumbru"

df2 <- do_time_out_success(df1, day_num, game_code, 
                           "Casademont Zaragoza_Porfirio Fisac", FALSE)
#df2

Run the code above in your browser using DataLab