meysubb / cfbscrapR-archived

CFB R Package
GNU General Public License v3.0
25 stars 9 forks source link

Update ep_calcs.R #27

Closed spfleming closed 4 years ago

spfleming commented 4 years ago

Converted lead() code to case-by-case to ensure the next-play down, distance, and yard line were correct. Converted kickoff down to consistent (down = 5) for easier identification. Defined 5 categories of plays(Normal, Turnover, Defense Score, Offense Score, Kickoff).

meysubb commented 4 years ago

Can you change all adj_yd_line to yards_to_goal?

EDIT: Fixed

meysubb commented 4 years ago

log_ydstogo = log(distance)

Need the right variable is logged

EDIT: Fixed

meysubb commented 4 years ago

Some additional fixes include

changing the turnover vector to be named as turnover_vec and same thing with defensive_score to defensive_score_vec

Those are column names in the dataframe and its causing some problems.

meysubb commented 4 years ago

closing this, since I brought your work in and implemented it