Learn R Programming

BAwiR (version 1.4.4)

do_clutch_time: Get games with clutch time

Description

Obtain the games that have clutch time. The clutch time is generally defined as the game situation when the scoring margin is within 5 points with five or fewer minutes remaining in a game. In order to allow more clutch situations, the user will be able to set the minutes left and the scoring difference.

Usage

do_clutch_time(data, min_left = "05:00", score_diff = 5)

Value

Data frame of the game that has clutch time.

Arguments

data

Source play-by-play data.

min_left

Minutes left to finish the game. Default 5 minutes.

score_diff

Scoring difference. Default 5 points.

Author

Guillermo Vinue

Examples

Run this code
df0 <- do_clutch_time(acb_vbc_cz_pbp_2223)
#df0 # If no rows, that means that the game did not have clutch time.

Run the code above in your browser using DataLab