prepare_bdb_week: Prepare a week of data from the 2021 Big Data Bowl

Description Usage Arguments Details

View source: R/cleaning_functions.R

Description

Prepare a week of data from the 2021 Big Data Bowl (data from 2018 season). To use this, you'll need to have the BDB data saved and unzipped somewhere in a directory on your computer.

Usage

1
2
3
4
5
6
7
8
prepare_bdb_week(
  week,
  dir = "../nfl-big-data-bowl-2021/input",
  trim_frame = 25,
  frames_after_throw = 10,
  keep_frames = NULL,
  drop_positions = c("QB")
)

Arguments

week

Get and prepare this week of data (1-17)

dir

Location of directory where BDB data lives. Default is unzipped to adjacent directory (default = "../nfl-big-data-bowl-2021/input")

trim_frame

If a throw, sack, etc happens before this frame, drop the play (default = 25; i.e. before 1.5 seconds into the play).

frames_after_throw

If a frame happened more than this many frames after throw, drop the frame.

keep_frames

Keep these frames. Default: NULL (ie keep all frames).

drop_positions

Drop these positions from the returned data (default = "QB").

Details

Loads raw .csvs from 2021 BDB, cleans, rotates, applies frame trimming, calculates orientation to QB, drops plays without at least 3 offensive and defensive players.


guga31bb/ngscleanR documentation built on Dec. 20, 2021, 1:47 p.m.