penalty_detection: Penalty Detection Adds penalty columns to Play-by-Play data...

Description Usage Arguments Details Value

View source: R/helper_pbp_penalty_detection.R

Description

Penalty Detection Adds penalty columns to Play-by-Play data pulled from the API

Usage

1

Arguments

raw_df

(data.frame required): Performs data cleansing on Play-by-Play DataFrame, as pulled from 'cfb_pbp_data()'

Details

Runs penalty detection on the play text and play types. Requires the following columns be present:

Value

The original 'raw_df' with the following columns appended/redefined:

penalty_flag

TRUE/FALSE flag for penalty play types or penalty in play text plays.

penalty_declined

TRUE/FALSE flag for 'declined' in penalty play types or penalty in play text plays.

penalty_no_play

TRUE/FALSE flag for 'no play' in penalty play types or penalty in play text plays.

penalty_offset

TRUE/FALSE flag for 'off-setting' in penalty play types or penalty in play text plays.

penalty_1st_conv

TRUE/FALSE flag for 1st Down in penalty play types or penalty in play text plays.

penalty_text

TRUE/FALSE flag for penalty in text but not a penalty play type.

orig_play_type

Copy of original play_type label prior to any changes by the proceeding functions

down

Defines kickoff downs and penalties on kickoffs and converts them from 5 (as from the API) to 1.

play_type

Defines 'play_type', "Penalty (Kickoff)", penalties on kickoffs with a repeat kick.

half

Defines the half variable (1, 2).


meysubb/cfbscrapR documentation built on Dec. 15, 2020, 11:26 p.m.