diff --git a/NAMESPACE b/NAMESPACE index d86c5ce..fff2f45 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,16 +5,20 @@ export(calc_fpts_common_formats) export(calc_fpts_ppg_common_formats) export(get_pbp_data) export(get_player_data) +export(get_qb_combined_stats_season) export(get_qb_ngs_advstats_season) export(get_qb_pbp_stats) export(get_qb_pfr_advstats_season) +export(get_rb_combined_stats_season) export(get_rb_ngs_advstats_season) export(get_rb_pbp_stats) export(get_rb_pfr_advstats_season) export(get_snap_share) +export(get_te_combined_stats_season) export(get_te_ngs_advstats_season) export(get_te_pbp_stats) export(get_te_pfr_advstats_season) +export(get_wr_combined_stats_season) export(get_wr_ngs_advstats_season) export(get_wr_pbp_stats) export(get_wr_pfr_advstats_season) diff --git a/R/calculate_fpts.R b/R/calculate_fpts.R index 5e67a3a..f1f87eb 100644 --- a/R/calculate_fpts.R +++ b/R/calculate_fpts.R @@ -1,12 +1,26 @@ +################################################################################ +# Author: Nolan MacDonald +# Purpose: +# Calculate total fantasy points and points per game (PPG) based on standard +# scoring formats. +# Code Style Guide: +# styler::tidyverse_style(), lintr::use_lintr(type = "tidyverse") +################################################################################ + #' Calculate Fantasy Points #' +#' @description +#' Calculate fantasy points using play-by-play and data and user-defined +#' scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR) +#' +#' #' @param pbp Play-by-play Dataframe #' @param pass_td_pts Passing Touchdown Points #' @param pass_int_pts Passing Interception Points #' @param rec_pts Reception Points #' #' @return -#' Calculate fantasy points using play-by-play and data and user-defined +#' Dataframe with total fantasy points using play-by-play data and user-defined #' scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR) #' #' @author Nolan MacDonald @@ -38,11 +52,69 @@ calc_fpts <- function(pbp = pbp, #' Calculate Fantasy Points for Common Scoring Formats #' -#' @param pbp Play-by-play Dataframe +#' @description +#' Calculate fantasy points using play-by-play data and common +#' scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) +#' +#' @param pbp Play-by-play Data frame #' #' @return -#' Calculate fantasy points using play-by-play and data and common +#' Data frame with total fantasy points for common #' scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) +#' +#' @seealso \code{\link[nuclearff]{calc_fpts}} +#' Calculate total fantasy points +#' +#' @author Nolan MacDonald +#' +#' @format A data frame with 79 variables that are described below. +#' \describe{ +#' \item{\code{fpts_std_4pt_td}}{ +#' Total fantasy points for standard scoring with 4 point touchdowns +#' } +#' \item{\code{ppg_std_4pt_td}}{ +#' Points per game (PPG) for standard scoring with 4 point touchdowns +#' } +#' \item{\code{fpts_half_ppr_4pt_td}}{ +#' Total fantasy points for half point per reception (Half PPR) scoring +#' with 4 point touchdowns +#' } +#' \item{\code{ppg_half_ppr_4pt_td}}{ +#' Points per game (PPG) for half point per reception (Half PPR) scoring +#' with 4 point touchdowns +#' } +#' \item{\code{fpts_ppr_4pt_td}}{ +#' Total fantasy points for point per reception (full PPR) scoring with +#' 4 point touchdowns +#' } +#' \item{\code{ppg_ppr_4pt_td}}{ +#' Points per game (PPG) for point per reception (Full PPR) scoring +#' with 4 point touchdowns +#' } +#' \item{\code{fpts_std_6pt_td}}{ +#' Total fantasy points for standard scoring with 6 point touchdowns +#' } +#' \item{\code{ppg_std_6pt_td}}{ +#' Points per game (PPG) for standard scoring with 6 point touchdowns +#' } +#' \item{\code{fpts_half_ppr_6pt_td}}{ +#' Total fantasy points for half point per reception (Half PPR) scoring +#' with 6 point touchdowns +#' } +#' \item{\code{ppg_half_ppr_6pt_td}}{ +#' Points per game (PPG) for half point per reception (Half PPR) scoring +#' with 6 point touchdowns +#' } +#' \item{\code{fpts_ppr_6pt_td}}{ +#' Total fantasy points for point per reception (full PPR) scoring with +#' 6 point touchdowns +#' } +#' \item{\code{ppg_ppr_6pt_td}}{ +#' Points per game (PPG) for point per reception (Full PPR) scoring +#' with 6 point touchdowns +#' } +#' } +#' #' @export calc_fpts_common_formats <- function(pbp = pbp) { @@ -105,11 +177,19 @@ calc_fpts_common_formats <- function(pbp = pbp) #' Calculate Fantasy Points Per Game for Common Scoring Formats #' +#' @description +#' Calculate fantasy points per game using play-by-play and data and common +#' scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) +#' +#' #' @param pbp Play-by-play Dataframe #' #' @return -#' Calculate fantasy points per game using play-by-play and data and common +#' Dataframe with fantasy points per game (PPG) using common #' scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) +#' +#' @author Nolan MacDonald +#' #' @export calc_fpts_ppg_common_formats <- function(pbp = pbp) { diff --git a/R/get_combined_stats_season.R b/R/get_combined_stats_season.R index f2dc82a..02cf280 100644 --- a/R/get_combined_stats_season.R +++ b/R/get_combined_stats_season.R @@ -7,6 +7,227 @@ # styler::tidyverse_style(), lintr::use_lintr(type = "tidyverse") ################################################################################ +#' QB Cumulative Season Advanced Stats +#' +#' @description +#' Obtain QB stats from NFL cumulative season stats for a specified time frame +#' from either a saved database or `nflreadr::load_pbp()`. The stats are +#' obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +#' Reference (PFR). +#' +#' @details +#' The function `get_qb_combined_stats_season` can be utilized to obtain +#' player stats for a season, including advanced stats. +#' This includes stats for passing, rushing, and receiving obtained by using +#' the `nflfastR` function `calculate_player_stats()`. +#' The player stats are utilized to calculate fantasy points +#' based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +#' The function acquires stats by using cumulative play-by-play data +#' by either loading from a saved database or using `nflreadr::load_pbp()`. +#' The data is obtained for a user-defined season. +#' Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +#' `nflreadr` function `load_nextgen_stats` to load player level weekly stats +#' starting with the 2016 season. +#' Play-by-play data is also merged with advanced stats from +#' Pro Football Reference (PFR), beginning from 2018. +#' Note that to use this function, `seasons` must be 2018 or later. +#' +#' @param pbp_dp Play-by-Play database path (optional) +#' @param pbp_db_tbl Play-by-Play database table name (optional) +#' @param seasons NFL season (required) to obtain play-by-play data. The +#' season can be defined as a single season, `season = 2024`. For multiple +#' seasons, use either `season = c(2023,2024)` or `season = 2022:2024`. +#' +#' @return Dataframe with QB stats for user-defined season(s) obtained from NFL +#' play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +#' +#' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} +#' Obtain play-by-play data for a specified time frame from either a saved +#' database or if not defined, using `nflreadr::load_pbp()` +#' @seealso \code{\link[nflreadr]{load_pbp}} +#' Load play-by-play data +#' @seealso \code{\link[nflfastR]{update_db}} +#' Update or Create a nflfastR Play-by-Play Database +#' @seealso \code{\link[nflreadr]{load_nextgen_stats}} +#' Load player level weekly NFL Next Gen Stats +#' @seealso \code{\link[nflreadr]{load_pfr_advstats}} +#' Load advanced stats from PFR +#' +#' @author Nolan MacDonald +#' +#' @format A data frame with 79 variables that are described below. +#' \describe{ +#' \item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +#' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +#' \item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +#' \item{\code{pos}}{Player position (e.g., QB)} +#' \item{\code{tm}}{Player team (e.g., BAL)} +#' \item{\code{g}}{Number of games played} +#' \item{\code{completions}}{Total pass completions (CMP)from PBP data} +#' \item{\code{attempts}}{Total pass attempts (ATT)from PBP data} +#' \item{\code{cmp_pct}}{Pass completion percentage from PBP data} +#' \item{\code{expected_completion_percentage}}{ +#' Expected completion percentage from NGS +#' } +#' \item{\code{completion_percentage_above_expectation}}{ +#' Average expected completion percentage (xCOMP) from NGS +#' } +#' \item{\code{passing_yards}}{Total passing yards from PBP data} +#' \item{\code{passing_tds}}{Total passing touchdowns from PBP data} +#' \item{\code{interceptions}}{Total pass interceptions (INT) from PBP data} +#' \item{\code{passing_epa}}{ +#' Total expected points added (EPA) on pass attempts and sacks. +#' NOTE: This uses the variable `qb_epa`, which gives QB credit for EPA for +#' up to the point where a receiver lost a fumble after a completed catch +#' and makes EPA work more like passing yards on plays with fumbles +#' } +#' \item{\code{passer_rating}}{Average passer rating from NGS} +#' \item{\code{pacr}}{ +#' Passing Air Conversion Ratio. +#' PACR = `passing_yards` / `passing_air_yards` from PBP data +#' } +#' \item{\code{dakota}}{ +#' Adjusted EPA + CPOE composite based on coefficients which best predicts +#' adjusted EPA/play in the following year from PBP data +#' } +#' \item{\code{aggressiveness}}{Average aggressiveness (AGG%) from NGS} +#' \item{\code{passing_air_yards}}{ +#' Passing air yards (includes incomplete passes) from PBP data +#' } +#' \item{\code{passing_yards_after_catch}}{ +#' Yards after the catch gained on plays in which player was the passer +#' (this is an unofficial stat and may differ slightly between different +#' sources) from PBP data +#' } +#' \item{\code{avg_air_distance}}{Average air distance from NGS} +#' \item{\code{max_air_distance}}{Maximum or longest air distance from NGS} +#' \item{\code{avg_time_to_throw}}{Average time to throw (TT) from NGS} +#' \item{\code{avg_completed_air_yards}}{ +#' Average completed air yards (CAY) from NGS +#' } +#' \item{\code{avg_intended_air_yards}}{ +#' Average intended air yards (IAY) from NGS +#' } +#' \item{\code{avg_air_yards_differential}}{ +#' Average air yards differential (AYD) from NGS +#' } +#' \item{\code{max_completed_air_distance}}{ +#' Maximum or longest completed air distance (LCAD) from NGS +#' } +#' \item{\code{avg_air_yards_to_sticks}}{ +#' Average air yards to the sticks (AYTS) from NGS +#' } +#' \item{\code{passing_first_downs}}{ +#' First downs on pass attempts from PBP data +#' } +#' \item{\code{throwaways}}{Number of throwaways from PFR} +#' \item{\code{spikes}}{Number of spikes from PFR} +#' \item{\code{drops}}{Number of throws dropped from PFR} +#' \item{\code{drop_pct}}{Percentage of dropped throws from PFR} +#' \item{\code{bad_throws}}{Number of bad throws from PFR} +#' \item{\code{bad_throw_pct}}{Percentage of bad throws from PFR} +#' \item{\code{pocket_time}}{Average time in pocket from PFR} +#' \item{\code{times_blitzed}}{Number of times blitzed from PFR} +#' \item{\code{times_hurried}}{Number of times hurried from PFR} +#' \item{\code{times_hit}}{Number of times hit from PFR} +#' \item{\code{times_pressured}}{Number of times pressured from PFR} +#' \item{\code{pressure_pct}}{Percent of time pressured from PFR} +#' \item{\code{batted_balls}}{Number of batted balls from PFR} +#' \item{\code{on_tgt_throws}}{Number of throws on target from PFR} +#' \item{\code{on_tgt_pct}}{Percent of throws on target from PFR} +#' \item{\code{rpo_plays}}{Run-pass-option (RPO) number of plays from PFR} +#' \item{\code{rpo_yards}}{Run-pass-option (RPO) total yards from PFR} +#' \item{\code{rpo_pass_att}}{Run-pass-option (RPO) pass attempts from PFR} +#' \item{\code{rpo_pass_yards}}{Run-pass-option (RPO) pass yards from PFR} +#' \item{\code{rpo_rush_att}}{Run-pass-option (RPO) rush attempts from PFR} +#' \item{\code{rpo_rush_yards}}{Run-pass-option (RPO) rush yards from PFR} +#' \item{\code{pa_pass_att}}{Play action pass attempts from PFR} +#' \item{\code{pa_pass_yards}}{Play action pass yards from PFR} +#' \item{\code{passing_2pt_conversions}}{ +#' Two-point conversion passes from PBP data +#' } +#' \item{\code{sacks}}{Total number of sacks taken from PBP data} +#' \item{\code{sack_yards}}{Total yards taken from sacks from PBP data} +#' \item{\code{sack_fumbles}}{Total fumbles from sacks from PBP data} +#' \item{\code{sack_fumbles_lost}}{Total fumbles lost from sacks from PBP data} +#' \item{\code{carries}}{ +#' Number of rush attempts including scrambles and kneel downs. Rushes after +#' a lateral reception don't count as a carry from PBP data +#' } +#' \item{\code{rushing_yards}}{ +#' Yards gained when rushing including scrambles and kneel downs. Also +#' includes yards gained after obtaining a lateral on a play that started +#' with a rushing attempt from PBP data +#' } +#' \item{\code{rushing_tds}}{ +#' The number of rushing touchdowns (incl. scrambles). Also includes +#' touchdowns after obtaining a lateral on a play that started with a +#' rushing attempt from PBP data +#' } +#' \item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +#' \item{\code{rushing_fumbles_lost}}{ +#' Number of rushes with a lost fumble from PBP data +#' } +#' \item{\code{rushing_first_downs}}{ +#' Number of rushing first downs from PBP data +#' } +#' \item{\code{rushing_epa}}{ +#' Expected points added (EPA) on rush attempts including scrambles and +#' kneel downs from PBP data +#' } +#' \item{\code{rushing_2pt_conversions}}{ +#' Two-point conversion rushes from PBP data +#' } +#' \item{\code{fpts_std_4pt_td}}{ +#' Total fantasy points for standard scoring with 4 point touchdowns +#' } +#' \item{\code{ppg_std_4pt_td}}{ +#' Points per game (PPG) for standard scoring with 4 point touchdowns +#' } +#' \item{\code{fpts_half_ppr_4pt_td}}{ +#' Total fantasy points for half point per reception (Half PPR) scoring +#' with 4 point touchdowns +#' } +#' \item{\code{ppg_half_ppr_4pt_td}}{ +#' Points per game (PPG) for half point per reception (Half PPR) scoring +#' with 4 point touchdowns +#' } +#' \item{\code{fpts_ppr_4pt_td}}{ +#' Total fantasy points for point per reception (full PPR) scoring with +#' 4 point touchdowns +#' } +#' \item{\code{ppg_ppr_4pt_td}}{ +#' Points per game (PPG) for point per reception (Full PPR) scoring +#' with 4 point touchdowns +#' } +#' \item{\code{fpts_std_6pt_td}}{ +#' Total fantasy points for standard scoring with 6 point touchdowns +#' } +#' \item{\code{ppg_std_6pt_td}}{ +#' Points per game (PPG) for standard scoring with 6 point touchdowns +#' } +#' \item{\code{fpts_half_ppr_6pt_td}}{ +#' Total fantasy points for half point per reception (Half PPR) scoring +#' with 6 point touchdowns +#' } +#' \item{\code{ppg_half_ppr_6pt_td}}{ +#' Points per game (PPG) for half point per reception (Half PPR) scoring +#' with 6 point touchdowns +#' } +#' \item{\code{fpts_ppr_6pt_td}}{ +#' Total fantasy points for point per reception (full PPR) scoring with +#' 6 point touchdowns +#' } +#' \item{\code{ppg_ppr_6pt_td}}{ +#' Points per game (PPG) for point per reception (Full PPR) scoring +#' with 6 point touchdowns +#' } +#' \item{\code{pfr_id}}{ +#' Pro Football Reference player ID (e.g., JackLa00) +#' } +#' } +#' +#' @export get_qb_combined_stats_season <- function(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) { @@ -18,10 +239,10 @@ get_qb_combined_stats_season <- function(pbp_db = NULL, # Pull RB PBP data qb_pbp <- get_qb_pbp_stats( - pbp_db = "./data/pbp_db", - pbp_db_tbl = "nflfastR_pbp", - season = 2024, - week_min = 1 + pbp_db, + pbp_db_tbl, + seasons, + week_min = 1 # Pulling entire season starting from week 1 ) %>% # Clean up player names in defined player column nuclearff::replace_player_names(player_col = "player_display_name") @@ -188,6 +409,195 @@ get_qb_combined_stats_season <- function(pbp_db = NULL, return(qb_combined_stats) } + +#' RB Cumulative Season Advanced Stats +#' +#' @description +#' Obtain RB stats from NFL cumulative season stats for a specified time frame +#' from either a saved database or `nflreadr::load_pbp()`. The stats are +#' obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +#' Reference (PFR). +#' +#' @details +#' The function `get_rb_combined_stats_season` can be utilized to obtain +#' player stats for a season, including advanced stats. +#' This includes stats for passing, rushing, and receiving obtained by using +#' the `nflfastR` function `calculate_player_stats()`. +#' The player stats are utilized to calculate fantasy points +#' based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +#' The function acquires stats by using cumulative play-by-play data +#' by either loading from a saved database or using `nflreadr::load_pbp()`. +#' The data is obtained for a user-defined season. +#' Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +#' `nflreadr` function `load_nextgen_stats` to load player level weekly stats +#' starting with the 2016 season. +#' Play-by-play data is also merged with advanced stats from +#' Pro Football Reference (PFR), beginning from 2018. +#' Note that to use this function, `seasons` must be 2018 or later. +#' +#' @param pbp_dp Play-by-Play database path (optional) +#' @param pbp_db_tbl Play-by-Play database table name (optional) +#' @param seasons NFL season (required) to obtain play-by-play data. The +#' season can be defined as a single season, `season = 2024`. For multiple +#' seasons, use either `season = c(2023,2024)` or `season = 2022:2024`. +#' +#' @return Dataframe with QB stats for user-defined season(s) obtained from NFL +#' play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +#' +#' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} +#' Obtain play-by-play data for a specified time frame from either a saved +#' database or if not defined, using `nflreadr::load_pbp()` +#' @seealso \code{\link[nflreadr]{load_pbp}} +#' Load play-by-play data +#' @seealso \code{\link[nflfastR]{update_db}} +#' Update or Create a nflfastR Play-by-Play Database +#' @seealso \code{\link[nflreadr]{load_nextgen_stats}} +#' Load player level weekly NFL Next Gen Stats +#' @seealso \code{\link[nflreadr]{load_pfr_advstats}} +#' Load advanced stats from PFR +#' +#' @author Nolan MacDonald +#' +#' @format A data frame with 57 variables that are described below. +#' \describe{ +#' \item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +#' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +#' \item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +#' \item{\code{pos}}{Player position (e.g., QB)} +#' \item{\code{tm}}{Player team (e.g., BAL)} +#' \item{\code{g}}{Number of games played} +#' \item{\code{carries}}{ +#' Number of rush attempts including scrambles and kneel downs. Rushes after +#' a lateral reception don't count as a carry from PBP data +#' } +#' \item{\code{rushing_yards}}{ +#' Yards gained when rushing including scrambles and kneel downs. Also +#' includes yards gained after obtaining a lateral on a play that started +#' with a rushing attempt from PBP data +#' } +#' \item{\code{rushing_tds}}{ +#' The number of rushing touchdowns (incl. scrambles). Also includes +#' touchdowns after obtaining a lateral on a play that started with a +#' rushing attempt from PBP data +#' } +#' \item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +#' \item{\code{rushing_fumbles_lost}}{ +#' Number of rushes with a lost fumble from PBP data +#' } +#' \item{\code{rushing_first_downs}}{ +#' Number of rushing first downs from PBP data +#' } +#' \item{\code{rushing_epa}}{ +#' Expected points added (EPA) on rush attempts including scrambles and +#' kneel downs from PBP data +#' } +#' \item{\code{rushing_2pt_conversions}}{ +#' Two-point conversion rushes from PBP data +#' } +#' \item{\code{efficiency}}{Average efficiency (EFF) from NGS} +#' \item{\code{percent_attempts_gte_eight_defenders }}{ +#' Average percent attempts with 8+ Defenders in the Box (8+D) from NGS +#' } +#' \item{\code{avg_time_to_los}}{ +#' Average time behind line of scrimmage (TLOS) from NGS +#' } +#' \item{\code{avg_rush_yards}}{Average rush yards per attempt} +#' \item{\code{expected_rush_yards}}{Average expected rush yards from NGS} +#' \item{\code{rush_yards_over_expected}}{ +#' Average rush yards over expected from NGS +#' } +#' \item{\code{rush_yards_over_expected_per_att}}{ +#' Average rush yards over expected per attempt from NGS +#' } +#' \item{\code{rush_pct_over_expected}}{ +#' Average rush percent over expected from NGS +#' } +#' \item{\code{ybc}}{Rushing yards before contact from PFR} +#' \item{\code{ybc_att}}{ +#' Rushing yards before contact per rushing attempt from PFR +#' } +#' \item{\code{yac}}{Rushing yards after contact from PFR} +#' \item{\code{yac_att}}{Rushing yards after contact per attempt from PFR} +#' \item{\code{brk_tkl}}{Broken tackles on rushes from PFR} +#' \item{\code{att_br}}{Rush attempts per broken tackle from PFR} +#' \item{\code{fpts_std_4pt_td}}{ +#' Fantasy points for standard format with 4 point TD +#' } +#' \item{\code{ppg_std_4pt_td}}{ +#' Fantasy points per game for standard format with 4 point TD +#' } +#' \item{\code{fpts_half_ppr_4pt_td}}{ +#' Fantasy points for half PPR format with 4 point TD +#' } +#' \item{\code{ppg_half_ppr_4pt_td}}{ +#' Fantasy points per game for half PPR format with 4 point TD +#' } +#' \item{\code{fpts_ppr_4pt_td}}{ +#' Fantasy points for full PPR format with 4 point TD +#' } +#' \item{\code{ppg_ppr_4pt_td}}{ +#' Fantasy points per game for full PPR format with 4 point TD +#' } +#' \item{\code{fpts_std_6pt_td}}{ +#' Fantasy points for standard format with 6 point TD +#' } +#' \item{\code{ppg_std_6pt_td}}{ +#' Fantasy points per game for standard format with 6 point TD +#' } +#' \item{\code{fpts_half_ppr_6pt_td}}{ +#' Fantasy points for half PPR format with 6 point TD +#' } +#' \item{\code{ppg_half_ppr_6pt_td}}{ +#' Fantasy points per game for half PPR format with 6 point TD +#' } +#' \item{\code{fpts_ppr_6pt_td}}{ +#' Fantasy points for full PPR format with 6 point TD +#' } +#' \item{\code{ppg_ppr_6pt_td}}{ +#' Fantasy points per game for full PPR format with 6 point TD +#' } +#' \item{\code{tgt}}{ +#' Number of pass plays where the player was targeted as a receiver from +#' PBP data +#' } +#' \item{\code{rec}}{ +#' Number of pass receptions. Lateral receptions don't count as a reception +#' from PBP data +#' } +#' \item{\code{rec_yds}}{ +#' Yards gained after a pass reception. Includes yards gained after +#' receiving a lateral on a play that started as a pass play from PBP data +#' } +#' \item{\code{rec_td}}{ +#' Number of reception touchdowns, including after receiving a lateral on a +#' play that began as a pass play from PBP data +#' } +#' \item{\code{receiving_fumbles}}{Number of fumbles after a pass reception +#' from PBP data +#' } +#' \item{\code{receiving_fumbles_lost}}{ +#' Number of fumbles lost after a pass reception from PBP data +#' } +#' \item{\code{receiving_air}}{ +#' Receiving air yards including incomplete passes from PBP data +#' } +#' \item{\code{yac_rec}}{ +#' Yards after the catch gained on plays in which player was receiver (this +#' is an unofficial stat and may differ slightly between different sources) +#' from PBP data +#' } +#' \item{\code{x1d_rec}}{ +#' Number of first downs gained on a reception from PBP data +#' } +#' \item{\code{receiving_epa}}{Expected points added on receptions +#' from PBP data +#' } +#' \item{\code{pfr_id}}{ +#' Pro Football Reference player ID (e.g., JackLa00) +#' } +#' } +#' +#' @export get_rb_combined_stats_season <- function(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) { @@ -199,9 +609,9 @@ get_rb_combined_stats_season <- function(pbp_db = NULL, # Pull RB PBP data rb_pbp <- nuclearff::get_rb_pbp_stats( - pbp_db = "./data/pbp_db", - pbp_db_tbl = "nflfastR_pbp", - season = 2024, + pbp_db, + pbp_db_tbl, + seasons, week_min = 1 # Pulling entire season starting from week 1 ) %>% # Clean up player names in defined player column @@ -267,7 +677,7 @@ get_rb_combined_stats_season <- function(pbp_db = NULL, # Combine RB play-by-play data, PFR data, and NGS data rb_combined_stats <- rb_pbp_pfr %>% - left_join(rb_ngs, by = common_vars_pbp_pfr_ngs) # %>% + left_join(rb_ngs, by = common_vars_pbp_pfr_ngs) %>% dplyr::select( player_id, player_display_name, @@ -288,6 +698,7 @@ get_rb_combined_stats_season <- function(pbp_db = NULL, efficiency, percent_attempts_gte_eight_defenders, avg_time_to_los, + avg_rush_yards, expected_rush_yards, rush_yards_over_expected, rush_yards_over_expected_per_att, @@ -299,7 +710,6 @@ get_rb_combined_stats_season <- function(pbp_db = NULL, yac_att, brk_tkl, att_br, - avg_rush_yards, # Fantasy Points fpts_std_4pt_td, ppg_std_4pt_td, @@ -321,9 +731,8 @@ get_rb_combined_stats_season <- function(pbp_db = NULL, receiving_fumbles, receiving_fumbles_lost, rec_air = receiving_air_yards, - yac = receiving_yards_after_catch, # yards after catch (YAC) - yac_r, # Yards after catch per reception (YAC/R) PFR - x1d = receiving_first_downs, # Receiving first downs (x1D) + yac_rec = receiving_yards_after_catch, # yards after catch (YAC) + x1d_rec = receiving_first_downs, # Receiving first downs (x1D) receiving_epa, # Receiving expected points added (EPA) receiving_2pt_conversions, racr, @@ -338,7 +747,209 @@ get_rb_combined_stats_season <- function(pbp_db = NULL, return(rb_combined_stats) } - +#' WR Cumulative Season Advanced Stats +#' +#' @description +#' Obtain WR stats from NFL cumulative season stats for a specified time frame +#' from either a saved database or `nflreadr::load_pbp()`. The stats are +#' obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +#' Reference (PFR). +#' +#' @details +#' The function `get_wr_combined_stats_season` can be utilized to obtain +#' player stats for a season, including advanced stats. +#' This includes stats for passing, rushing, and receiving obtained by using +#' the `nflfastR` function `calculate_player_stats()`. +#' The player stats are utilized to calculate fantasy points +#' based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +#' The function acquires stats by using cumulative play-by-play data +#' by either loading from a saved database or using `nflreadr::load_pbp()`. +#' The data is obtained for a user-defined season. +#' Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +#' `nflreadr` function `load_nextgen_stats` to load player level weekly stats +#' starting with the 2016 season. +#' Play-by-play data is also merged with advanced stats from +#' Pro Football Reference (PFR), beginning from 2018. +#' Note that to use this function, `seasons` must be 2018 or later. +#' +#' @param pbp_dp Play-by-Play database path (optional) +#' @param pbp_db_tbl Play-by-Play database table name (optional) +#' @param seasons NFL season (required) to obtain play-by-play data. The +#' season can be defined as a single season, `season = 2024`. For multiple +#' seasons, use either `season = c(2023,2024)` or `season = 2022:2024`. +#' @return Dataframe with QB stats for user-defined season(s) obtained from NFL +#' play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +#' +#' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} +#' Obtain play-by-play data for a specified time frame from either a saved +#' database or if not defined, using `nflreadr::load_pbp()` +#' @seealso \code{\link[nflreadr]{load_pbp}} +#' Load play-by-play data +#' @seealso \code{\link[nflfastR]{update_db}} +#' Update or Create a nflfastR Play-by-Play Database +#' @seealso \code{\link[nflreadr]{load_nextgen_stats}} +#' Load player level weekly NFL Next Gen Stats +#' @seealso \code{\link[nflreadr]{load_pfr_advstats}} +#' Load advanced stats from PFR +#' +#' @author Nolan MacDonald +#' +#' @format A data frame with 61 variables that are described below. +#' \describe{ +#' \item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +#' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +#' \item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +#' \item{\code{pos}}{Player position (e.g., QB)} +#' \item{\code{tm}}{Player team (e.g., BAL)} +#' \item{\code{g}}{Number of games played} +#' \item{\code{tgt}}{ +#' Number of pass plays where the player was targeted as a receiver from +#' PBP data +#' } +#' \item{\code{rec}}{ +#' Number of pass receptions. Lateral receptions don't count as a reception +#' from PBP data +#' } +#' \item{\code{rec_yds}}{ +#' Yards gained after a pass reception. Includes yards gained after +#' receiving a lateral on a play that started as a pass play from PBP data +#' } +#' \item{\code{rec_td}}{ +#' Number of reception touchdowns, including after receiving a lateral on a +#' play that began as a pass play from PBP data +#' } +#' \item{\code{avg_yac}}{Average yards after catch (YAC) from NGS} +#' \item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC) from NGS} +#' \item{\code{avg_yac_above_expectation}}{ +#' Average yards after catch above expectation (+/-) from NGS +#' } +#' \item{\code{yac}}{Yards after catch (YAC) from PFR} +#' \item{\code{yac_r}}{Yards after catch (YAC) per reception from PFR} +#' \item{\code{adot}}{ +#' Average depth of target (ADOT) when targeted, whether completed or not, +#' from PFR +#' } +#' \item{\code{receiving_epa}}{Expected points added on receptions +#' from PBP data +#' } +#' \item{\code{racr}}{ +#' Receiving Air Conversion Ratio. +#' RACR = `receiving_yards` / `receiving_air_yards` from PBP +#' } +#' \item{\code{wopr}}{ +#' Weighted Opportunity Rating. +#' WOPR = 1.5 x `target_share` + 0.7 x `air_yards_share` from PBP data +#' } +#' \item{\code{avg_cushion}}{Average cushion (CUSH) from NGS} +#' \item{\code{avg_separation}}{Average separation (SEP) from NGS} +#' \item{\code{target_share}}{ +#' Share of targets of player compared to all team targets from PBP +#' } +#' \item{\code{tgt_pct}}{Share of targets percentage from PBP} +#' \item{\code{ybc}}{ +#' Total yards passes traveled in the air before being caught or yards +#' before catch (YBC) from PFR} +#' \item{\code{ybc_r}}{Yards before catch per reception from PFR} +#' \item{\code{receiving_air}}{ +#' Receiving air yards including incomplete passes from PBP data +#' } +#' \item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY) from NGS} +#' \item{\code{percent_share_of_intended_air_yards}}{ +#' Average % share of team's air yards (TAY%) from NGS +#' } +#' \item{\code{air_yards_share}}{ +#' Share of `receiving_air_yards` of the player to all team `air_yards` +#' from PBP data +#' } +#' \item{\code{x1d_rec}}{ +#' Number of first downs gained on a reception from PBP data +#' } +#' \item{\code{brk_tkl}}{Number of broken tackles from PFR} +#' \item{\code{rec_br}}{Receptions per broken tackle from PFR} +#' \item{\code{drop}}{Number of dropped passes from PFR} +#' \item{\code{drop_percent}}{Dropped pass percentage when targeted from PFR} +#' \item{\code{catch_percentage}}{Average catch percentage from NGS} +#' \item{\code{receiving_fumbles}}{Number of fumbles after a pass reception +#' from PBP data +#' } +#' \item{\code{receiving_fumbles_lost}}{ +#' Number of fumbles lost after a pass reception from PBP data +#' } +#' \item{\code{receiving_2pt_conversions}}{ +#' Two-point conversion receptions from PBP data +#' } +#' \item{\code{int_tgt}}{Interceptions on passes where targetedfrom PFR} +#' \item{\code{rat}}{Passer rating on passes when targeted from PFR} +#' \item{\code{fpts_std_4pt_td}}{ +#' Fantasy points for standard format with 4 point TD +#' } +#' \item{\code{ppg_std_4pt_td}}{ +#' Fantasy points per game for standard format with 4 point TD +#' } +#' \item{\code{fpts_half_ppr_4pt_td}}{ +#' Fantasy points for half PPR format with 4 point TD +#' } +#' \item{\code{ppg_half_ppr_4pt_td}}{ +#' Fantasy points per game for half PPR format with 4 point TD +#' } +#' \item{\code{fpts_ppr_4pt_td}}{ +#' Fantasy points for full PPR format with 4 point TD +#' } +#' \item{\code{ppg_ppr_4pt_td}}{ +#' Fantasy points per game for full PPR format with 4 point TD +#' } +#' \item{\code{fpts_std_6pt_td}}{ +#' Fantasy points for standard format with 6 point TD +#' } +#' \item{\code{ppg_std_6pt_td}}{ +#' Fantasy points per game for standard format with 6 point TD +#' } +#' \item{\code{fpts_half_ppr_6pt_td}}{ +#' Fantasy points for half PPR format with 6 point TD +#' } +#' \item{\code{ppg_half_ppr_6pt_td}}{ +#' Fantasy points per game for half PPR format with 6 point TD +#' } +#' \item{\code{fpts_ppr_6pt_td}}{ +#' Fantasy points for full PPR format with 6 point TD +#' } +#' \item{\code{ppg_ppr_6pt_td}}{ +#' Fantasy points per game for full PPR format with 6 point TD +#' } +#' \item{\code{carries}}{ +#' Number of rush attempts including scrambles and kneel downs. Rushes after +#' a lateral reception don't count as a carry from PBP data +#' } +#' \item{\code{rushing_yards}}{ +#' Yards gained when rushing including scrambles and kneel downs. Also +#' includes yards gained after obtaining a lateral on a play that started +#' with a rushing attempt from PBP data +#' } +#' \item{\code{rushing_tds}}{ +#' The number of rushing touchdowns (incl. scrambles). Also includes +#' touchdowns after obtaining a lateral on a play that started with a +#' rushing attempt from PBP data +#' } +#' \item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +#' \item{\code{rushing_fumbles_lost}}{ +#' Number of rushes with a lost fumble from PBP data +#' } +#' \item{\code{rushing_first_downs}}{ +#' Number of rushing first downs from PBP data +#' } +#' \item{\code{rushing_epa}}{ +#' Expected points added (EPA) on rush attempts including scrambles and +#' kneel downs from PBP data +#' } +#' \item{\code{rushing_2pt_conversions}}{ +#' Two-point conversion rushes from PBP data +#' } +#' \item{\code{pfr_id}}{ +#' Pro Football Reference player ID (e.g., JackLa00) +#' } +#' } +#' +#' @export get_wr_combined_stats_season <- function(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) { @@ -350,9 +961,9 @@ get_wr_combined_stats_season <- function(pbp_db = NULL, # Pull WR PBP data wr_pbp <- nuclearff::get_wr_pbp_stats( - pbp_db = "./data/pbp_db", - pbp_db_tbl = "nflfastR_pbp", - season = 2024, + pbp_db, + pbp_db_tbl, + seasons, week_min = 1 # Pulling entire season starting from week 1 ) %>% # Clean up player names in defined player column @@ -494,6 +1105,210 @@ get_wr_combined_stats_season <- function(pbp_db = NULL, return(wr_combined_stats) } +#' TE Cumulative Season Advanced Stats +#' +#' @description +#' Obtain TE stats from NFL cumulative season stats for a specified time frame +#' from either a saved database or `nflreadr::load_pbp()`. The stats are +#' obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +#' Reference (PFR). +#' +#' @details +#' The function `get_te_combined_stats_season` can be utilized to obtain +#' player stats for a season, including advanced stats. +#' This includes stats for passing, rushing, and receiving obtained by using +#' the `nflfastR` function `calculate_player_stats()`. +#' The player stats are utilized to calculate fantasy points +#' based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +#' The function acquires stats by using cumulative play-by-play data +#' by either loading from a saved database or using `nflreadr::load_pbp()`. +#' The data is obtained for a user-defined season. +#' Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +#' `nflreadr` function `load_nextgen_stats` to load player level weekly stats +#' starting with the 2016 season. +#' Play-by-play data is also merged with advanced stats from +#' Pro Football Reference (PFR), beginning from 2018. +#' Note that to use this function, `seasons` must be 2018 or later. +#' +#' @param pbp_dp Play-by-Play database path (optional) +#' @param pbp_db_tbl Play-by-Play database table name (optional) +#' @param seasons NFL season (required) to obtain play-by-play data. The +#' season can be defined as a single season, `season = 2024`. For multiple +#' seasons, use either `season = c(2023,2024)` or `season = 2022:2024`. +#' +#' @return Dataframe with QB stats for user-defined season(s) obtained from NFL +#' play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +#' +#' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} +#' Obtain play-by-play data for a specified time frame from either a saved +#' database or if not defined, using `nflreadr::load_pbp()` +#' @seealso \code{\link[nflreadr]{load_pbp}} +#' Load play-by-play data +#' @seealso \code{\link[nflfastR]{update_db}} +#' Update or Create a nflfastR Play-by-Play Database +#' @seealso \code{\link[nflreadr]{load_nextgen_stats}} +#' Load player level weekly NFL Next Gen Stats +#' @seealso \code{\link[nflreadr]{load_pfr_advstats}} +#' Load advanced stats from PFR +#' +#' @author Nolan MacDonald +#' +#' @format A data frame with 61 variables that are described below. +#' \describe{ +#' \item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +#' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +#' \item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +#' \item{\code{pos}}{Player position (e.g., QB)} +#' \item{\code{tm}}{Player team (e.g., BAL)} +#' \item{\code{g}}{Number of games played} +#' \item{\code{tgt}}{ +#' Number of pass plays where the player was targeted as a receiver from +#' PBP data +#' } +#' \item{\code{rec}}{ +#' Number of pass receptions. Lateral receptions don't count as a reception +#' from PBP data +#' } +#' \item{\code{rec_yds}}{ +#' Yards gained after a pass reception. Includes yards gained after +#' receiving a lateral on a play that started as a pass play from PBP data +#' } +#' \item{\code{rec_td}}{ +#' Number of reception touchdowns, including after receiving a lateral on a +#' play that began as a pass play from PBP data +#' } +#' \item{\code{avg_yac}}{Average yards after catch (YAC) from NGS} +#' \item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC) from NGS} +#' \item{\code{avg_yac_above_expectation}}{ +#' Average yards after catch above expectation (+/-) from NGS +#' } +#' \item{\code{yac}}{Yards after catch (YAC) from PFR} +#' \item{\code{yac_r}}{Yards after catch (YAC) per reception from PFR} +#' \item{\code{adot}}{ +#' Average depth of target (ADOT) when targeted, whether completed or not, +#' from PFR +#' } +#' \item{\code{receiving_epa}}{Expected points added on receptions +#' from PBP data +#' } +#' \item{\code{racr}}{ +#' Receiving Air Conversion Ratio. +#' RACR = `receiving_yards` / `receiving_air_yards` from PBP +#' } +#' \item{\code{wopr}}{ +#' Weighted Opportunity Rating. +#' WOPR = 1.5 x `target_share` + 0.7 x `air_yards_share` from PBP data +#' } +#' \item{\code{avg_cushion}}{Average cushion (CUSH) from NGS} +#' \item{\code{avg_separation}}{Average separation (SEP) from NGS} +#' \item{\code{target_share}}{ +#' Share of targets of player compared to all team targets from PBP +#' } +#' \item{\code{tgt_pct}}{Share of targets percentage from PBP} +#' \item{\code{ybc}}{ +#' Total yards passes traveled in the air before being caught or yards +#' before catch (YBC) from PFR} +#' \item{\code{ybc_r}}{Yards before catch per reception from PFR} +#' \item{\code{receiving_air}}{ +#' Receiving air yards including incomplete passes from PBP data +#' } +#' \item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY) from NGS} +#' \item{\code{percent_share_of_intended_air_yards}}{ +#' Average % share of team's air yards (TAY%) from NGS +#' } +#' \item{\code{air_yards_share}}{ +#' Share of `receiving_air_yards` of the player to all team `air_yards` +#' from PBP data +#' } +#' \item{\code{x1d_rec}}{ +#' Number of first downs gained on a reception from PBP data +#' } +#' \item{\code{brk_tkl}}{Number of broken tackles from PFR} +#' \item{\code{rec_br}}{Receptions per broken tackle from PFR} +#' \item{\code{drop}}{Number of dropped passes from PFR} +#' \item{\code{drop_percent}}{Dropped pass percentage when targeted from PFR} +#' \item{\code{catch_percentage}}{Average catch percentage from NGS} +#' \item{\code{receiving_fumbles}}{Number of fumbles after a pass reception +#' from PBP data +#' } +#' \item{\code{receiving_fumbles_lost}}{ +#' Number of fumbles lost after a pass reception from PBP data +#' } +#' \item{\code{receiving_2pt_conversions}}{ +#' Two-point conversion receptions from PBP data +#' } +#' \item{\code{int_tgt}}{Interceptions on passes where targetedfrom PFR} +#' \item{\code{rat}}{Passer rating on passes when targeted from PFR} +#' \item{\code{fpts_std_4pt_td}}{ +#' Fantasy points for standard format with 4 point TD +#' } +#' \item{\code{ppg_std_4pt_td}}{ +#' Fantasy points per game for standard format with 4 point TD +#' } +#' \item{\code{fpts_half_ppr_4pt_td}}{ +#' Fantasy points for half PPR format with 4 point TD +#' } +#' \item{\code{ppg_half_ppr_4pt_td}}{ +#' Fantasy points per game for half PPR format with 4 point TD +#' } +#' \item{\code{fpts_ppr_4pt_td}}{ +#' Fantasy points for full PPR format with 4 point TD +#' } +#' \item{\code{ppg_ppr_4pt_td}}{ +#' Fantasy points per game for full PPR format with 4 point TD +#' } +#' \item{\code{fpts_std_6pt_td}}{ +#' Fantasy points for standard format with 6 point TD +#' } +#' \item{\code{ppg_std_6pt_td}}{ +#' Fantasy points per game for standard format with 6 point TD +#' } +#' \item{\code{fpts_half_ppr_6pt_td}}{ +#' Fantasy points for half PPR format with 6 point TD +#' } +#' \item{\code{ppg_half_ppr_6pt_td}}{ +#' Fantasy points per game for half PPR format with 6 point TD +#' } +#' \item{\code{fpts_ppr_6pt_td}}{ +#' Fantasy points for full PPR format with 6 point TD +#' } +#' \item{\code{ppg_ppr_6pt_td}}{ +#' Fantasy points per game for full PPR format with 6 point TD +#' } +#' \item{\code{carries}}{ +#' Number of rush attempts including scrambles and kneel downs. Rushes after +#' a lateral reception don't count as a carry from PBP data +#' } +#' \item{\code{rushing_yards}}{ +#' Yards gained when rushing including scrambles and kneel downs. Also +#' includes yards gained after obtaining a lateral on a play that started +#' with a rushing attempt from PBP data +#' } +#' \item{\code{rushing_tds}}{ +#' The number of rushing touchdowns (incl. scrambles). Also includes +#' touchdowns after obtaining a lateral on a play that started with a +#' rushing attempt from PBP data +#' } +#' \item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +#' \item{\code{rushing_fumbles_lost}}{ +#' Number of rushes with a lost fumble from PBP data +#' } +#' \item{\code{rushing_first_downs}}{ +#' Number of rushing first downs from PBP data +#' } +#' \item{\code{rushing_epa}}{ +#' Expected points added (EPA) on rush attempts including scrambles and +#' kneel downs from PBP data +#' } +#' \item{\code{rushing_2pt_conversions}}{ +#' Two-point conversion rushes from PBP data +#' } +#' \item{\code{pfr_id}}{ +#' Pro Football Reference player ID (e.g., JackLa00) +#' } +#' } +#' +#' @export get_te_combined_stats_season <- function(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) { @@ -505,9 +1320,9 @@ get_te_combined_stats_season <- function(pbp_db = NULL, # Pull TE PBP data te_pbp <- nuclearff::get_te_pbp_stats( - pbp_db = "./data/pbp_db", - pbp_db_tbl = "nflfastR_pbp", - season = 2024, + pbp_db, + pbp_db_tbl, + seasons, week_min = 1 # Pulling entire season starting from week 1 ) %>% # Clean up player names in defined player column @@ -529,7 +1344,7 @@ get_te_combined_stats_season <- function(pbp_db = NULL, # Combine PBP data with roster information and IDs te_stats <- te_pbp %>% - left_join(wr_data, + left_join(te_data, by = c("player_id", "player_display_name", "position", diff --git a/R/get_ngs_advstats_season.R b/R/get_ngs_advstats_season.R index 90c7578..3dbfa6b 100644 --- a/R/get_ngs_advstats_season.R +++ b/R/get_ngs_advstats_season.R @@ -34,7 +34,8 @@ #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 33 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} #' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} #' \item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} @@ -46,7 +47,7 @@ #' \item{\code{attempts}}{Total pass attempts} #' \item{\code{completions}}{Total pass completions} #' \item{\code{completion_percentage}}{Average completion percentage (%)} -#' \item{\code{expected_completion_percentage}}{} +#' \item{\code{expected_completion_percentage}}{Expected completion percentage} #' \item{\code{completion_percentage_above_expectation}}{ #' Average expected completion percentage (xCOMP) #' } @@ -159,7 +160,8 @@ get_qb_ngs_advstats_season <- function(seasons = NULL) { #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 15 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} #' \item{\code{player_display_name}}{Player name (e.g., Breece Hall)} #' \item{\code{player_name}}{Player shortened name (e.g., B.Hall)} @@ -254,7 +256,8 @@ get_rb_ngs_advstats_season <- function(seasons = NULL) { #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 16 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0039337)} #' \item{\code{player_display_name}}{Player name (e.g., Malik Nabers)} #' \item{\code{player_name}}{Player shortened name (e.g., M.Nabers)} @@ -266,10 +269,10 @@ get_rb_ngs_advstats_season <- function(seasons = NULL) { #' \item{\code{avg_cushion}}{Average cushion (CUSH)} #' \item{\code{avg_separation}}{Average separation (SEP)} #' \item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY)} -#' \item{\code{avg_percent_share_of_intended_air_yards}}{ +#' \item{\code{percent_share_of_intended_air_yards}}{ #' Average % share of team's air yards (TAY%) #' } -#' \item{\code{avg_catch_percentage}}{Average catch percentage} +#' \item{\code{catch_percentage}}{Average catch percentage} #' \item{\code{avg_yac}}{Average yards after catch (YAC)} #' \item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC)} #' \item{\code{avg_yac_above_expectation}}{ @@ -346,7 +349,8 @@ get_wr_ngs_advstats_season <- function(seasons = NULL) { #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 16 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0037744)} #' \item{\code{player_display_name}}{Player name (e.g., Trey McBride)} #' \item{\code{player_name}}{Player shortened name (e.g., T.McBride)} diff --git a/R/get_pbp_stats.R b/R/get_pbp_stats.R index 0d9ae56..5d51631 100644 --- a/R/get_pbp_stats.R +++ b/R/get_pbp_stats.R @@ -44,7 +44,7 @@ #' #' @param pbp_dp Play-by-Play database path (optional) #' @param pbp_db_tbl Play-by-Play database table name (optional) -#' @param season NFL season (required) to obtain play-by-play data. The +#' @param seasons NFL season(s) (required) to obtain play-by-play data. The #' season can be defined as a single season, `season = 2024`. For multiple #' seasons, use either `season = c(2023,2024)` or `season = 2022:2024`. #' @param week_min Minimum week (required) to define whether pulling a range @@ -59,15 +59,16 @@ #' #' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} #' Obtain play-by-play data for a specified time frame from either a saved -#' database or if not defined, using `nflreadr::load_pbp()`, +#' database or if not defined, using `nflreadr::load_pbp()` #' @seealso \code{\link[nflreadr]{load_pbp}} -#' Load play-by-play data, +#' Load play-by-play data #' @seealso \code{\link[nflfastR]{update_db}} #' Update or Create a nflfastR Play-by-Play Database #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 57 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} #' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} #' \item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} @@ -199,11 +200,11 @@ #' @export get_qb_pbp_stats <- function(pbp_db = NULL, pbp_db_tbl = NULL, - season = NULL, + seasons = NULL, week_min = NULL, week_max = NULL) { # Load play-by-play data with database or nflreadr - pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, season, week_min, week_max) + pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, seasons, week_min, week_max) # Filter data for RB stats and compile qb_pbp <- pbp %>% @@ -219,7 +220,7 @@ get_qb_pbp_stats <- function(pbp_db = NULL, tgt_pct = target_share * 100 ) %>% dplyr::inner_join( - nflfastR::fast_scraper_roster(season) %>% + nflfastR::fast_scraper_roster(seasons) %>% # Filter by player position dplyr::filter(position == "QB") %>% dplyr::select(player_id = gsis_id), @@ -321,7 +322,7 @@ get_qb_pbp_stats <- function(pbp_db = NULL, #' #' @param pbp_dp Play-by-Play database path (optional) #' @param pbp_db_tbl Play-by-Play database table name (optional) -#' @param season NFL season (required) to obtain play-by-play data. The +#' @param seasons NFL season(s) (required) to obtain play-by-play data. The #' season can be defined as a single season, `season = 2024`. For multiple #' seasons, use either `season = c(2023,2024)` or `season = 2022:2024`. #' @param week_min Minimum week (required) to define whether pulling a range @@ -336,15 +337,16 @@ get_qb_pbp_stats <- function(pbp_db = NULL, #' #' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} #' Obtain play-by-play data for a specified time frame from either a saved -#' database or if not defined, using `nflreadr::load_pbp()`, +#' database or if not defined, using `nflreadr::load_pbp()` #' @seealso \code{\link[nflreadr]{load_pbp}} -#' Load play-by-play data, +#' Load play-by-play data #' @seealso \code{\link[nflfastR]{update_db}} #' Update or Create a nflfastR Play-by-Play Database #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 59 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} #' \item{\code{player_display_name}}{Player name (e.g., Breece Hall)} #' \item{\code{player_name}}{Player shortened name (e.g., B.Hall)} @@ -492,11 +494,11 @@ get_qb_pbp_stats <- function(pbp_db = NULL, #' @export get_rb_pbp_stats <- function(pbp_db = NULL, pbp_db_tbl = NULL, - season = NULL, + seasons = NULL, week_min = NULL, week_max = NULL) { # Load play-by-play data with database or nflreadr - pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, season, week_min, week_max) + pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, seasons, week_min, week_max) # Filter data for RB stats and compile rb_pbp <- pbp %>% @@ -512,7 +514,7 @@ get_rb_pbp_stats <- function(pbp_db = NULL, tgt_pct = target_share * 100 ) %>% dplyr::inner_join( - nflfastR::fast_scraper_roster(season) %>% + nflfastR::fast_scraper_roster(seasons) %>% # Filter by player position dplyr::filter(position == "RB") %>% dplyr::select(player_id = gsis_id), @@ -620,7 +622,7 @@ get_rb_pbp_stats <- function(pbp_db = NULL, #' #' @param pbp_dp Play-by-Play database path (optional) #' @param pbp_db_tbl Play-by-Play database table name (optional) -#' @param season NFL season (required) to obtain play-by-play data. The +#' @param seasons NFL season(s) (required) to obtain play-by-play data. The #' season can be defined as a single season, `season = 2024`. For multiple #' seasons, use either `season = c(2023,2024)` #' @param week_min Minimum week (required) to define whether pulling a range @@ -633,13 +635,18 @@ get_rb_pbp_stats <- function(pbp_db = NULL, #' @return Dataframe with WR stats for user-defined season(s) and week(s) #' obtained from NFL play-by-play data #' -#' @seealso \code{\link[nuclearff]{get_pbp_data}}, -#' \code{\link[nflreadr]{load_pbp}}, -#' \code{\link[nflfastR]{update_db}} +#' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} +#' Obtain play-by-play data for a specified time frame from either a saved +#' database or if not defined, using `nflreadr::load_pbp()` +#' @seealso \code{\link[nflreadr]{load_pbp}} +#' Load play-by-play data +#' @seealso \code{\link[nflfastR]{update_db}} +#' Update or Create a nflfastR Play-by-Play Database #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 59 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} #' \item{\code{player_display_name}}{Player name (e.g., Breece Hall)} #' \item{\code{player_name}}{Player shortened name (e.g., B.Hall)} @@ -787,11 +794,11 @@ get_rb_pbp_stats <- function(pbp_db = NULL, #' @export get_wr_pbp_stats <- function(pbp_db = NULL, pbp_db_tbl = NULL, - season = NULL, + seasons = NULL, week_min = NULL, week_max = NULL) { # Load play-by-play data with database or nflreadr - pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, season, week_min, week_max) + pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, seasons, week_min, week_max) # Filter data for RB stats and compile wr_pbp <- pbp %>% @@ -807,7 +814,7 @@ get_wr_pbp_stats <- function(pbp_db = NULL, tgt_pct = target_share * 100 ) %>% dplyr::inner_join( - nflfastR::fast_scraper_roster(season) %>% + nflfastR::fast_scraper_roster(seasons) %>% # Filter by player position dplyr::filter(position == "WR") %>% dplyr::select(player_id = gsis_id), @@ -913,17 +920,9 @@ get_wr_pbp_stats <- function(pbp_db = NULL, #' https://www.nflfastr.com/reference/calculate_player_stats.html #' ) #' -#' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}}: -#' Obtain play-by-play data for a specified time frame from either a saved -#' database or if not defined, using `nflreadr::load_pbp()`, -#' @seealso \code{\link[nflreadr]{load_pbp}} -#' Load play-by-play data, -#' @seealso \code{\link[nflfastR]{update_db}} -#' Update or Create a nflfastR Play-by-Play Database -#' #' @param pbp_dp Play-by-Play database path (optional) #' @param pbp_db_tbl Play-by-Play database table name (optional) -#' @param season NFL season (required) to obtain play-by-play data. The +#' @param seasons NFL season(s) (required) to obtain play-by-play data. The #' season can be defined as a single season, `season = 2024`. For multiple #' seasons, use either `season = c(2023,2024)` or `season = 2022:2024`. #' @param week_min Minimum week (required) to define whether pulling a range @@ -936,9 +935,18 @@ get_wr_pbp_stats <- function(pbp_db = NULL, #' @return Dataframe with TE stats for user-defined season(s) and week(s) #' obtained from NFL play-by-play data #' +#' @seealso \code{\link[nuclearff]{nuclearff::get_pbp_data}} +#' Obtain play-by-play data for a specified time frame from either a saved +#' database or if not defined, using `nflreadr::load_pbp()` +#' @seealso \code{\link[nflreadr]{load_pbp}} +#' Load play-by-play data +#' @seealso \code{\link[nflfastR]{update_db}} +#' Update or Create a nflfastR Play-by-Play Database +#' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 59 variables that are described below. +#' \describe{ #' \item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} #' \item{\code{player_display_name}}{Player name (e.g., Breece Hall)} #' \item{\code{player_name}}{Player shortened name (e.g., B.Hall)} @@ -1086,11 +1094,11 @@ get_wr_pbp_stats <- function(pbp_db = NULL, #' @export get_te_pbp_stats <- function(pbp_db = NULL, pbp_db_tbl = NULL, - season = NULL, + seasons = NULL, week_min = NULL, week_max = NULL) { # Load play-by-play data with database or nflreadr - pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, season, week_min, week_max) + pbp <- nuclearff::get_pbp_data(pbp_db, pbp_db_tbl, seasons, week_min, week_max) # Filter data for RB stats and compile te_pbp <- pbp %>% @@ -1106,7 +1114,7 @@ get_te_pbp_stats <- function(pbp_db = NULL, tgt_pct = target_share * 100 ) %>% dplyr::inner_join( - nflfastR::fast_scraper_roster(season) %>% + nflfastR::fast_scraper_roster(seasons) %>% # Filter by player position dplyr::filter(position == "TE") %>% dplyr::select(player_id = gsis_id), diff --git a/R/get_pfr_advstats_season.R b/R/get_pfr_advstats_season.R index bbf21af..12121e0 100644 --- a/R/get_pfr_advstats_season.R +++ b/R/get_pfr_advstats_season.R @@ -35,7 +35,8 @@ #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 26 variables that are described below. +#' \describe{ #' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} #' \item{\code{pass_attempts}}{Total pass attempts} #' \item{\code{throwaways}}{Number of throwaways} @@ -144,7 +145,8 @@ get_qb_pfr_advstats_season <- function(seasons = NULL) { #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 16 variables that are described below. +#' \describe{ #' \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} #' \item{\code{age}}{} #' \item{\code{position}}{} @@ -233,7 +235,8 @@ get_rb_pfr_advstats_season <- function(seasons = NULL) { #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 22 variables that are described below. +#' \describe{ #' \item{\code{player_display_name}}{Player name (e.g., Malik Nabers)} #' \item{\code{age}}{Player age} #' \item{\code{position}}{Player position} @@ -338,7 +341,8 @@ get_wr_pfr_advstats_season <- function(seasons = NULL) { #' #' @author Nolan MacDonald #' -#' \itemize{ +#' @format A data frame with 22 variables that are described below. +#' \describe{ #' \item{\code{player_display_name}}{Player name (e.g., George Kittle)} #' \item{\code{age}}{Player age} #' \item{\code{position}}{Player position} diff --git a/R/helpers_rosters.R b/R/helpers_rosters.R index ebb07fc..ccedc19 100644 --- a/R/helpers_rosters.R +++ b/R/helpers_rosters.R @@ -33,13 +33,13 @@ replace_player_names <- function(df, player_col = "player") { df %>% dplyr::mutate( !!player_col_sym := dplyr::case_when( - position == "RB" & !!player_col_sym == "De'Von Achane" ~ "Devon Achane", - position == "RB" & !!player_col_sym == "Kenneth Walker III" ~ "Kenneth Walker", - position == "RB" & !!player_col_sym == "Jeff Wilson" ~ "Jeffery Wilson", - position == "RB" & !!player_col_sym == "Chris Brooks" ~ "Christopher Brooks", - position == "WR" & !!player_col_sym == "Gabriel Davis" ~ "Gabe Davis", - position == "WR" & !!player_col_sym == "D.K. Metcalf" ~ "DK Metcalf", - position == "TE" & !!player_col_sym == "AJ Barner" ~ "A.J. Barner", + !!player_col_sym == "De'Von Achane" ~ "Devon Achane", + !!player_col_sym == "Kenneth Walker III" ~ "Kenneth Walker", + !!player_col_sym == "Jeff Wilson" ~ "Jeffery Wilson", + !!player_col_sym == "Chris Brooks" ~ "Christopher Brooks", + !!player_col_sym == "Gabriel Davis" ~ "Gabe Davis", + !!player_col_sym == "D.K. Metcalf" ~ "DK Metcalf", + !!player_col_sym == "AJ Barner" ~ "A.J. Barner", # Remove Jr. or Sr. when detected stringr::str_detect(!!player_col_sym, "\\s*(Jr\\.|Sr\\.)$") ~ stringr::str_replace(!!player_col_sym, "\\s*(Jr\\.|Sr\\.)$", ""), # Remove II or III when detected diff --git a/_pkgdown.yml b/_pkgdown.yml index 4a96c26..170dfa9 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -8,24 +8,43 @@ reference: desc: > Functions available in `nuclearff` -- subtitle: "Useful Functions" +- subtitle: "Play-by-Play Stats" contents: - get_pbp_data - get_qb_pbp_stats - get_rb_pbp_stats - get_wr_pbp_stats - get_te_pbp_stats + +- subtitle: "Calculate Fantasy Points" + contents: - calc_fpts - calc_fpts_common_formats - calc_fpts_ppg_common_formats + +- subtitle: "NFL Next Gen Stats (NGS)" + contents: - get_qb_ngs_advstats_season - get_rb_ngs_advstats_season - get_wr_ngs_advstats_season - get_te_ngs_advstats_season + +- subtitle: "Pro Football Reference (PFR) Stats" + contents: - get_qb_pfr_advstats_season - get_rb_pfr_advstats_season - get_wr_pfr_advstats_season - get_te_pfr_advstats_season + +- subtitle: "Combined Stats from All Sources" + contents: + - get_qb_combined_stats_season + - get_rb_combined_stats_season + - get_wr_combined_stats_season + - get_te_combined_stats_season + +- subtitle: "Additional Utilities" + contents: - get_player_data - get_snap_share diff --git a/docs/katex-auto.js b/docs/katex-auto.js old mode 100644 new mode 100755 diff --git a/docs/lightswitch.js b/docs/lightswitch.js old mode 100644 new mode 100755 diff --git a/docs/link.svg b/docs/link.svg old mode 100644 new mode 100755 diff --git a/docs/pkgdown.js b/docs/pkgdown.js old mode 100644 new mode 100755 diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index f0e9361..41d3f6a 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: setup_pbp_db: setup_pbp_db.html -last_built: 2024-10-05T19:06Z +last_built: 2024-10-07T21:42Z urls: reference: https://github.com/NuclearAnalyticsLab/nuclearff/reference article: https://github.com/NuclearAnalyticsLab/nuclearff/articles diff --git a/docs/reference/calc_fpts.html b/docs/reference/calc_fpts.html index e26423d..958b6ca 100644 --- a/docs/reference/calc_fpts.html +++ b/docs/reference/calc_fpts.html @@ -1,5 +1,7 @@ -Calculate Fantasy Points — calc_fpts • nuclearff +Calculate Fantasy Points — calc_fpts • nuclearff Skip to contents @@ -32,7 +34,8 @@
-

Calculate Fantasy Points

+

Calculate fantasy points using play-by-play and data and user-defined +scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR)

@@ -62,7 +65,7 @@

Arguments

Value

-

Calculate fantasy points using play-by-play and data and user-defined +

Dataframe with total fantasy points using play-by-play data and user-defined scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR)

diff --git a/docs/reference/calc_fpts_common_formats.html b/docs/reference/calc_fpts_common_formats.html index a62f267..3a5aa4f 100644 --- a/docs/reference/calc_fpts_common_formats.html +++ b/docs/reference/calc_fpts_common_formats.html @@ -1,5 +1,7 @@ -Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats • nuclearff +Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats • nuclearff Skip to contents @@ -32,7 +34,8 @@
-

Calculate Fantasy Points for Common Scoring Formats

+

Calculate fantasy points using play-by-play data and common +scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)

@@ -40,19 +43,76 @@

Usage
calc_fpts_common_formats(pbp = pbp)

+
+

Format

+

A data frame with 79 variables that are described below.

fpts_std_4pt_td
+

Total fantasy points for standard scoring with 4 point touchdowns

+ +
ppg_std_4pt_td
+

Points per game (PPG) for standard scoring with 4 point touchdowns

+ +
fpts_half_ppr_4pt_td
+

Total fantasy points for half point per reception (Half PPR) scoring +with 4 point touchdowns

+ +
ppg_half_ppr_4pt_td
+

Points per game (PPG) for half point per reception (Half PPR) scoring +with 4 point touchdowns

+ +
fpts_ppr_4pt_td
+

Total fantasy points for point per reception (full PPR) scoring with +4 point touchdowns

+ +
ppg_ppr_4pt_td
+

Points per game (PPG) for point per reception (Full PPR) scoring +with 4 point touchdowns

+ +
fpts_std_6pt_td
+

Total fantasy points for standard scoring with 6 point touchdowns

+ +
ppg_std_6pt_td
+

Points per game (PPG) for standard scoring with 6 point touchdowns

+ +
fpts_half_ppr_6pt_td
+

Total fantasy points for half point per reception (Half PPR) scoring +with 6 point touchdowns

+ +
ppg_half_ppr_6pt_td
+

Points per game (PPG) for half point per reception (Half PPR) scoring +with 6 point touchdowns

+ +
fpts_ppr_6pt_td
+

Total fantasy points for point per reception (full PPR) scoring with +6 point touchdowns

+ +
ppg_ppr_6pt_td
+

Points per game (PPG) for point per reception (Full PPR) scoring +with 6 point touchdowns

+ + +

Arguments

pbp
-

Play-by-play Dataframe

+

Play-by-play Data frame

Value

-

Calculate fantasy points using play-by-play and data and common +

Data frame with total fantasy points for common scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)

+
+

See also

+

calc_fpts +Calculate total fantasy points

+
+
+

Author

+

Nolan MacDonald

+
diff --git a/docs/reference/calc_fpts_ppg_common_formats.html b/docs/reference/calc_fpts_ppg_common_formats.html index 8deab25..4d05674 100644 --- a/docs/reference/calc_fpts_ppg_common_formats.html +++ b/docs/reference/calc_fpts_ppg_common_formats.html @@ -1,5 +1,7 @@ -Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats • nuclearff +Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats • nuclearff Skip to contents @@ -32,7 +34,8 @@
-

Calculate Fantasy Points Per Game for Common Scoring Formats

+

Calculate fantasy points per game using play-by-play and data and common +scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)

@@ -50,9 +53,13 @@

Arguments

Value

-

Calculate fantasy points per game using play-by-play and data and common +

Dataframe with fantasy points per game (PPG) using common scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)

+
+

Author

+

Nolan MacDonald

+
diff --git a/docs/reference/get_player_data.html b/docs/reference/get_player_data.html index 53ceb17..b0f2895 100644 --- a/docs/reference/get_player_data.html +++ b/docs/reference/get_player_data.html @@ -37,18 +37,18 @@

Usage

-
get_player_data(season = NULL, pos = NULL)
+
get_player_data(seasons = NULL, position = NULL)

Arguments

-
season
+
seasons

NFL season or year (int)

-
pos
+
position

Player position (str) such as "WR"

diff --git a/docs/reference/get_qb_combined_stats_season.html b/docs/reference/get_qb_combined_stats_season.html new file mode 100644 index 0000000..733ac63 --- /dev/null +++ b/docs/reference/get_qb_combined_stats_season.html @@ -0,0 +1,393 @@ + +QB Cumulative Season Advanced Stats — get_qb_combined_stats_season • nuclearff + Skip to contents + + +
+
+
+ +
+

Obtain QB stats from NFL cumulative season stats for a specified time frame +from either a saved database or nflreadr::load_pbp(). The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR).

+
+ +
+

Usage

+
get_qb_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)
+
+ +
+

Format

+

A data frame with 79 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0034796)

+ +
player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
player_name
+

Player shortened name (e.g., L.Jackson)

+ +
pos
+

Player position (e.g., QB)

+ +
tm
+

Player team (e.g., BAL)

+ +
g
+

Number of games played

+ +
completions
+

Total pass completions (CMP)from PBP data

+ +
attempts
+

Total pass attempts (ATT)from PBP data

+ +
cmp_pct
+

Pass completion percentage from PBP data

+ +
expected_completion_percentage
+

Expected completion percentage from NGS

+ +
completion_percentage_above_expectation
+

Average expected completion percentage (xCOMP) from NGS

+ +
passing_yards
+

Total passing yards from PBP data

+ +
passing_tds
+

Total passing touchdowns from PBP data

+ +
interceptions
+

Total pass interceptions (INT) from PBP data

+ +
passing_epa
+

Total expected points added (EPA) on pass attempts and sacks. +NOTE: This uses the variable qb_epa, which gives QB credit for EPA for +up to the point where a receiver lost a fumble after a completed catch +and makes EPA work more like passing yards on plays with fumbles

+ +
passer_rating
+

Average passer rating from NGS

+ +
pacr
+

Passing Air Conversion Ratio. +PACR = passing_yards / passing_air_yards from PBP data

+ +
dakota
+

Adjusted EPA + CPOE composite based on coefficients which best predicts +adjusted EPA/play in the following year from PBP data

+ +
aggressiveness
+

Average aggressiveness (AGG%) from NGS

+ +
passing_air_yards
+

Passing air yards (includes incomplete passes) from PBP data

+ +
passing_yards_after_catch
+

Yards after the catch gained on plays in which player was the passer +(this is an unofficial stat and may differ slightly between different +sources) from PBP data

+ +
avg_air_distance
+

Average air distance from NGS

+ +
max_air_distance
+

Maximum or longest air distance from NGS

+ +
avg_time_to_throw
+

Average time to throw (TT) from NGS

+ +
avg_completed_air_yards
+

Average completed air yards (CAY) from NGS

+ +
avg_intended_air_yards
+

Average intended air yards (IAY) from NGS

+ +
avg_air_yards_differential
+

Average air yards differential (AYD) from NGS

+ +
max_completed_air_distance
+

Maximum or longest completed air distance (LCAD) from NGS

+ +
avg_air_yards_to_sticks
+

Average air yards to the sticks (AYTS) from NGS

+ +
passing_first_downs
+

First downs on pass attempts from PBP data

+ +
throwaways
+

Number of throwaways from PFR

+ +
spikes
+

Number of spikes from PFR

+ +
drops
+

Number of throws dropped from PFR

+ +
drop_pct
+

Percentage of dropped throws from PFR

+ +
bad_throws
+

Number of bad throws from PFR

+ +
bad_throw_pct
+

Percentage of bad throws from PFR

+ +
pocket_time
+

Average time in pocket from PFR

+ +
times_blitzed
+

Number of times blitzed from PFR

+ +
times_hurried
+

Number of times hurried from PFR

+ +
times_hit
+

Number of times hit from PFR

+ +
times_pressured
+

Number of times pressured from PFR

+ +
pressure_pct
+

Percent of time pressured from PFR

+ +
batted_balls
+

Number of batted balls from PFR

+ +
on_tgt_throws
+

Number of throws on target from PFR

+ +
on_tgt_pct
+

Percent of throws on target from PFR

+ +
rpo_plays
+

Run-pass-option (RPO) number of plays from PFR

+ +
rpo_yards
+

Run-pass-option (RPO) total yards from PFR

+ +
rpo_pass_att
+

Run-pass-option (RPO) pass attempts from PFR

+ +
rpo_pass_yards
+

Run-pass-option (RPO) pass yards from PFR

+ +
rpo_rush_att
+

Run-pass-option (RPO) rush attempts from PFR

+ +
rpo_rush_yards
+

Run-pass-option (RPO) rush yards from PFR

+ +
pa_pass_att
+

Play action pass attempts from PFR

+ +
pa_pass_yards
+

Play action pass yards from PFR

+ +
passing_2pt_conversions
+

Two-point conversion passes from PBP data

+ +
sacks
+

Total number of sacks taken from PBP data

+ +
sack_yards
+

Total yards taken from sacks from PBP data

+ +
sack_fumbles
+

Total fumbles from sacks from PBP data

+ +
sack_fumbles_lost
+

Total fumbles lost from sacks from PBP data

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data

+ +
rushing_fumbles
+

Number of rushes with a fumble from PBP data

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble from PBP data

+ +
rushing_first_downs
+

Number of rushing first downs from PBP data

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data

+ +
rushing_2pt_conversions
+

Two-point conversion rushes from PBP data

+ +
fpts_std_4pt_td
+

Total fantasy points for standard scoring with 4 point touchdowns

+ +
ppg_std_4pt_td
+

Points per game (PPG) for standard scoring with 4 point touchdowns

+ +
fpts_half_ppr_4pt_td
+

Total fantasy points for half point per reception (Half PPR) scoring +with 4 point touchdowns

+ +
ppg_half_ppr_4pt_td
+

Points per game (PPG) for half point per reception (Half PPR) scoring +with 4 point touchdowns

+ +
fpts_ppr_4pt_td
+

Total fantasy points for point per reception (full PPR) scoring with +4 point touchdowns

+ +
ppg_ppr_4pt_td
+

Points per game (PPG) for point per reception (Full PPR) scoring +with 4 point touchdowns

+ +
fpts_std_6pt_td
+

Total fantasy points for standard scoring with 6 point touchdowns

+ +
ppg_std_6pt_td
+

Points per game (PPG) for standard scoring with 6 point touchdowns

+ +
fpts_half_ppr_6pt_td
+

Total fantasy points for half point per reception (Half PPR) scoring +with 6 point touchdowns

+ +
ppg_half_ppr_6pt_td
+

Points per game (PPG) for half point per reception (Half PPR) scoring +with 6 point touchdowns

+ +
fpts_ppr_6pt_td
+

Total fantasy points for point per reception (full PPR) scoring with +6 point touchdowns

+ +
ppg_ppr_6pt_td
+

Points per game (PPG) for point per reception (Full PPR) scoring +with 6 point touchdowns

+ +
pfr_id
+

Pro Football Reference player ID (e.g., JackLa00)

+ + +
+
+

Arguments

+ + +
pbp_db_tbl
+

Play-by-Play database table name (optional)

+ + +
seasons
+

NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, season = 2024. For multiple +seasons, use either season = c(2023,2024) or season = 2022:2024.

+ + +
pbp_dp
+

Play-by-Play database path (optional)

+ +
+
+

Value

+

Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR)

+
+
+

Details

+

The function get_qb_combined_stats_season can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the nflfastR function calculate_player_stats(). +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using nflreadr::load_pbp(). +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +nflreadr function load_nextgen_stats to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, seasons must be 2018 or later.

+
+
+

See also

+

nuclearff::get_pbp_data +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using nflreadr::load_pbp()

+

load_pbp +Load play-by-play data

+

update_db +Update or Create a nflfastR Play-by-Play Database

+

load_nextgen_stats +Load player level weekly NFL Next Gen Stats

+

load_pfr_advstats +Load advanced stats from PFR

+
+
+

Author

+

Nolan MacDonald

+
+ +
+ + +
+ + + + + + + diff --git a/docs/reference/get_qb_ngs_advstats_season.html b/docs/reference/get_qb_ngs_advstats_season.html index 4017e9c..6199ebe 100644 --- a/docs/reference/get_qb_ngs_advstats_season.html +++ b/docs/reference/get_qb_ngs_advstats_season.html @@ -43,6 +43,76 @@

Usage
get_qb_ngs_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 33 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0034796)

+ +
player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
player_name
+

Player shortened name (e.g., L.Jackson)

+ +
position
+

Player position

+ +
pass_yards
+

Total pass yards

+ +
pass_touchdowns
+

Total pass touchdowns

+ +
interceptions
+

Total interceptions

+ +
passer_rating
+

Average passer rating

+ +
attempts
+

Total pass attempts

+ +
completions
+

Total pass completions

+ +
completion_percentage
+

Average completion percentage (%)

+ +
expected_completion_percentage
+

Expected completion percentage

+ +
completion_percentage_above_expectation
+

Average expected completion percentage (xCOMP)

+ +
avg_air_distance
+

Average air distance

+ +
max_air_distance
+

Maximum or longest air distance

+ +
avg_time_to_throw
+

Average time to throw (TT)

+ +
avg_completed_air_yards
+

Average completed air yards (CAY)

+ +
avg_intended_air_yards
+

Average intended air yards (IAY)

+ +
avg_air_yards_differential
+

Average air yards differential (AYD)

+ +
aggressiveness
+

Average aggressiveness (AGG%)

+ +
max_completed_air_distance
+

Maximum or longest completed air distance (LCAD)

+ +
avg_air_yards_to_sticks
+

Average air yards to the sticks (AYTS)

+ + +

Arguments

@@ -76,33 +146,7 @@

See also

Author

Nolan MacDonald

-
  • player_idPlayer gsis id (e.g., 00-0034796)

  • -
  • player_display_namePlayer name (e.g., Lamar Jackson)

  • -
  • player_namePlayer shortened name (e.g., L.Jackson)

  • -
  • positionPlayer position

  • -
  • pass_yardsTotal pass yards

  • -
  • pass_touchdownsTotal pass touchdowns

  • -
  • interceptionsTotal interceptions

  • -
  • passer_ratingAverage passer rating

  • -
  • attemptsTotal pass attempts

  • -
  • completionsTotal pass completions

  • -
  • completion_percentageAverage completion percentage (%)

  • -
  • expected_completion_percentage

  • -
  • completion_percentage_above_expectation -Average expected completion percentage (xCOMP)

  • -
  • avg_air_distanceAverage air distance

  • -
  • max_air_distanceMaximum or longest air distance

  • -
  • avg_time_to_throwAverage time to throw (TT)

  • -
  • avg_completed_air_yardsAverage completed air yards (CAY)

  • -
  • avg_intended_air_yardsAverage intended air yards (IAY)

  • -
  • avg_air_yards_differential -Average air yards differential (AYD)

  • -
  • aggressivenessAverage aggressiveness (AGG%)

  • -
  • max_completed_air_distance -Maximum or longest completed air distance (LCAD)

  • -
  • avg_air_yards_to_sticks -Average air yards to the sticks (AYTS)

  • -

+ diff --git a/docs/reference/get_qb_pbp_stats.html b/docs/reference/get_qb_pbp_stats.html index 9aab6e1..3e5178e 100644 --- a/docs/reference/get_qb_pbp_stats.html +++ b/docs/reference/get_qb_pbp_stats.html @@ -43,12 +43,190 @@

Usage
get_qb_pbp_stats(
   pbp_db = NULL,
   pbp_db_tbl = NULL,
-  season = NULL,
+  seasons = NULL,
   week_min = NULL,
   week_max = NULL
 )
+
+

Format

+

A data frame with 57 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0034796)

+ +
player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
player_name
+

Player shortened name (e.g., L.Jackson)

+ +
position
+

Player position (e.g., QB)

+ +
team
+

Player team (e.g., BAL)

+ +
games
+

Number of games played

+ +
fpts_std_4pt_td
+

Fantasy points for standard format with 4 point TD

+ +
ppg_std_4pt_td
+

Fantasy points per game for standard format with 4 point TD

+ +
fpts_half_ppr_4pt_td
+

Fantasy points for half PPR format with 4 point TD

+ +
ppg_half_ppr_4pt_td
+

Fantasy points per game for half PPR format with 4 point TD

+ +
fpts_ppr_4pt_td
+

Fantasy points for full PPR format with 4 point TD

+ +
ppg_ppr_4pt_td
+

Fantasy points per game for full PPR format with 4 point TD

+ +
fpts_std_6pt_td
+

Fantasy points for standard format with 6 point TD

+ +
ppg_std_6pt_td
+

Fantasy points per game for standard format with 6 point TD

+ +
fpts_half_ppr_6pt_td
+

Fantasy points for half PPR format with 6 point TD

+ +
ppg_half_ppr_6pt_td
+

Fantasy points per game for half PPR format with 6 point TD

+ +
fpts_ppr_6pt_td
+

Fantasy points for full PPR format with 6 point TD

+ +
ppg_ppr_6pt_td
+

Fantasy points per game for full PPR format with 6 point TD

+ +
completions
+

Total pass completions (CMP)

+ +
attempts
+

Total pass attempts (ATT)

+ +
cmp_pct
+

Pass completion percentage

+ +
passing_yards
+

Total passing yards

+ +
passing_tds
+

Total passing touchdowns

+ +
interceptions
+

Total pass interceptions (INT)

+ +
sacks
+

Total number of sacks taken

+ +
sack_yards
+

Total yards taken from sacks

+ +
sack_fumbles
+

Total fumbles from sacks

+ +
sack_fumbles_lost
+

Total fumbles lost from sacks

+ +
passing_air_yards
+

Passing air yards (includes incomplete passes)

+ +
passing_yards_after_catch
+

Yards after the catch gained on plays in which player was the passer +(this is an unofficial stat and may differ slightly between different +sources).

+ +
passing_first_downs
+

First downs on pass attempts

+ +
passing_epa
+

Total expected points added (EPA) on pass attempts and sacks. +NOTE: This uses the variable qb_epa, which gives QB credit for EPA for +up to the point where a receiver lost a fumble after a completed catch +and makes EPA work more like passing yards on plays with fumbles

+ +
passing_2pt_conversions
+

Two-point conversion passes

+ +
pacr
+

Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards

+ +
dakota
+

Adjusted EPA + CPOE composite based on coefficients which best predicts +adjusted EPA/play in the following year

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt

+ +
rushing_fumbles
+

Number of rushes with a fumble

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble

+ +
rushing_first_downs
+

Number of rushing first downs

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs

+ +
rushing_2pt_conversions
+

Two-point conversion rushes

+ +
targets
+

Number of pass plays where the player was targeted as a receiver

+ +
receptions
+

Number of pass receptions. Lateral receptions don't count as a reception

+ +
receiving_yards
+

Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play

+ +
receiving_tds
+

Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play

+ +
receiving_fumbles
+

Number of fumbles after a pass reception

+ +
receiving_fumbles_lost
+

Number of fumbles lost after a pass reception

+ +
receiving_air_yards
+

Receiving air yards including incomplete passes

+ +
receiving_yards_after_catch
+

Yards after the catch gained on plays in which player was receiver (this +is an unofficial stat and may differ slightly between different sources)

+ +
receiving_first_downs
+

Number of first downs gained on a reception

+ +
receiving_2pt_conversions
+

Two-point conversion receptions

+ + +

Arguments

@@ -57,8 +235,8 @@

Argumentsseason -

NFL season (required) to obtain play-by-play data. The +

seasons
+

NFL season(s) (required) to obtain play-by-play data. The season can be defined as a single season, season = 2024. For multiple seasons, use either season = c(2023,2024) or season = 2022:2024.

@@ -116,113 +294,16 @@

DetailsSee also

nuclearff::get_pbp_data Obtain play-by-play data for a specified time frame from either a saved -database or if not defined, using nflreadr::load_pbp(),

+database or if not defined, using nflreadr::load_pbp()

load_pbp -Load play-by-play data,

+Load play-by-play data

update_db Update or Create a nflfastR Play-by-Play Database

Author

Nolan MacDonald

-
+ diff --git a/docs/reference/get_qb_pfr_advstats_season.html b/docs/reference/get_qb_pfr_advstats_season.html index e6937ce..4e33ee5 100644 --- a/docs/reference/get_qb_pfr_advstats_season.html +++ b/docs/reference/get_qb_pfr_advstats_season.html @@ -43,6 +43,88 @@

Usage
get_qb_pfr_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 26 variables that are described below.

player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
pass_attempts
+

Total pass attempts

+ +
throwaways
+

Number of throwaways

+ +
spikes
+

Number of spikes

+ +
drops
+

Number of throws dropped

+ +
drop_pct
+

Percentage of dropped throws

+ +
bad_throws
+

Number of bad throws

+ +
bad_throw_pct
+

Percentage of bad throws

+ +
pocket_time
+

Average time in pocket

+ +
times_blitzed
+

Number of times blitzed

+ +
times_hurried
+

Number of times hurried

+ +
times_hit
+

Number of times hit

+ +
times_pressured
+

Number of times pressured

+ +
pressure_pct
+

Percent of time pressured

+ +
batted_balls
+

Number of batted balls

+ +
on_tgt_throws
+

Number of throws on target

+ +
on_tgt_pct
+

Percent of throws on target

+ +
rpo_plays
+

Run-pass-option (RPO) number of plays

+ +
rpo_yards
+

Run-pass-option (RPO) total yards

+ +
rpo_pass_att
+

Run-pass-option (RPO) pass attempts

+ +
rpo_pass_yards
+

Run-pass-option (RPO) pass yards

+ +
rpo_rush_att
+

Run-pass-option (RPO) rush attempts

+ +
rpo_rush_yards
+

Run-pass-option (RPO) rush yards

+ +
pa_pass_att
+

Play action pass attempts

+ +
pa_pass_yards
+

Play action pass yards

+ +
pfr_player_id
+

Pro Football Reference player ID (e.g., JackLa00)

+ + +

Arguments

@@ -74,34 +156,7 @@

See also

Author

Nolan MacDonald

-
  • player_display_namePlayer name (e.g., Lamar Jackson)

  • -
  • pass_attemptsTotal pass attempts

  • -
  • throwawaysNumber of throwaways

  • -
  • spikesNumber of spikes

  • -
  • dropsNumber of throws dropped

  • -
  • drop_pctPercentage of dropped throws

  • -
  • bad_throwsNumber of bad throws

  • -
  • bad_throw_pctPercentage of bad throws

  • -
  • pocket_timeAverage time in pocket

  • -
  • times_blitzedNumber of times blitzed

  • -
  • times_hurriedNumber of times hurried

  • -
  • times_hitNumber of times hit

  • -
  • times_pressuredNumber of times pressured

  • -
  • pressure_pctPercent of time pressured

  • -
  • batted_ballsNumber of batted balls

  • -
  • on_tgt_throwsNumber of throws on target

  • -
  • on_tgt_pctPercent of throws on target

  • -
  • rpo_playsRun-pass-option (RPO) number of plays

  • -
  • rpo_yardsRun-pass-option (RPO) total yards

  • -
  • rpo_pass_attRun-pass-option (RPO) pass attempts

  • -
  • rpo_pass_yardsRun-pass-option (RPO) pass yards

  • -
  • rpo_rush_attRun-pass-option (RPO) rush attempts

  • -
  • rpo_rush_yardsRun-pass-option (RPO) rush yards

  • -
  • pa_pass_attPlay action pass attempts

  • -
  • pa_pass_yardsPlay action pass yards

  • -
  • pfr_player_id -Pro Football Reference player ID (e.g., JackLa00)

  • -

+ diff --git a/docs/reference/get_rb_combined_stats_season.html b/docs/reference/get_rb_combined_stats_season.html new file mode 100644 index 0000000..5b84634 --- /dev/null +++ b/docs/reference/get_rb_combined_stats_season.html @@ -0,0 +1,302 @@ + +RB Cumulative Season Advanced Stats — get_rb_combined_stats_season • nuclearff + Skip to contents + + +
+
+
+ +
+

Obtain RB stats from NFL cumulative season stats for a specified time frame +from either a saved database or nflreadr::load_pbp(). The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR).

+
+ +
+

Usage

+
get_rb_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)
+
+ +
+

Format

+

A data frame with 57 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0034796)

+ +
player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
player_name
+

Player shortened name (e.g., L.Jackson)

+ +
pos
+

Player position (e.g., QB)

+ +
tm
+

Player team (e.g., BAL)

+ +
g
+

Number of games played

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data

+ +
rushing_fumbles
+

Number of rushes with a fumble from PBP data

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble from PBP data

+ +
rushing_first_downs
+

Number of rushing first downs from PBP data

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data

+ +
rushing_2pt_conversions
+

Two-point conversion rushes from PBP data

+ +
efficiency
+

Average efficiency (EFF) from NGS

+ +
percent_attempts_gte_eight_defenders
+

Average percent attempts with 8+ Defenders in the Box (8+D) from NGS

+ +
avg_time_to_los
+

Average time behind line of scrimmage (TLOS) from NGS

+ +
avg_rush_yards
+

Average rush yards per attempt

+ +
expected_rush_yards
+

Average expected rush yards from NGS

+ +
rush_yards_over_expected
+

Average rush yards over expected from NGS

+ +
rush_yards_over_expected_per_att
+

Average rush yards over expected per attempt from NGS

+ +
rush_pct_over_expected
+

Average rush percent over expected from NGS

+ +
ybc
+

Rushing yards before contact from PFR

+ +
ybc_att
+

Rushing yards before contact per rushing attempt from PFR

+ +
yac
+

Rushing yards after contact from PFR

+ +
yac_att
+

Rushing yards after contact per attempt from PFR

+ +
brk_tkl
+

Broken tackles on rushes from PFR

+ +
att_br
+

Rush attempts per broken tackle from PFR

+ +
fpts_std_4pt_td
+

Fantasy points for standard format with 4 point TD

+ +
ppg_std_4pt_td
+

Fantasy points per game for standard format with 4 point TD

+ +
fpts_half_ppr_4pt_td
+

Fantasy points for half PPR format with 4 point TD

+ +
ppg_half_ppr_4pt_td
+

Fantasy points per game for half PPR format with 4 point TD

+ +
fpts_ppr_4pt_td
+

Fantasy points for full PPR format with 4 point TD

+ +
ppg_ppr_4pt_td
+

Fantasy points per game for full PPR format with 4 point TD

+ +
fpts_std_6pt_td
+

Fantasy points for standard format with 6 point TD

+ +
ppg_std_6pt_td
+

Fantasy points per game for standard format with 6 point TD

+ +
fpts_half_ppr_6pt_td
+

Fantasy points for half PPR format with 6 point TD

+ +
ppg_half_ppr_6pt_td
+

Fantasy points per game for half PPR format with 6 point TD

+ +
fpts_ppr_6pt_td
+

Fantasy points for full PPR format with 6 point TD

+ +
ppg_ppr_6pt_td
+

Fantasy points per game for full PPR format with 6 point TD

+ +
tgt
+

Number of pass plays where the player was targeted as a receiver from +PBP data

+ +
rec
+

Number of pass receptions. Lateral receptions don't count as a reception +from PBP data

+ +
rec_yds
+

Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play from PBP data

+ +
rec_td
+

Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play from PBP data

+ +
receiving_fumbles
+

Number of fumbles after a pass reception +from PBP data

+ +
receiving_fumbles_lost
+

Number of fumbles lost after a pass reception from PBP data

+ +
receiving_air
+

Receiving air yards including incomplete passes from PBP data

+ +
yac_rec
+

Yards after the catch gained on plays in which player was receiver (this +is an unofficial stat and may differ slightly between different sources) +from PBP data

+ +
x1d_rec
+

Number of first downs gained on a reception from PBP data

+ +
receiving_epa
+

Expected points added on receptions +from PBP data

+ +
pfr_id
+

Pro Football Reference player ID (e.g., JackLa00)

+ + +
+
+

Arguments

+ + +
pbp_db_tbl
+

Play-by-Play database table name (optional)

+ + +
seasons
+

NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, season = 2024. For multiple +seasons, use either season = c(2023,2024) or season = 2022:2024.

+ + +
pbp_dp
+

Play-by-Play database path (optional)

+ +
+
+

Value

+

Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR)

+
+
+

Details

+

The function get_rb_combined_stats_season can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the nflfastR function calculate_player_stats(). +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using nflreadr::load_pbp(). +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +nflreadr function load_nextgen_stats to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, seasons must be 2018 or later.

+
+
+

See also

+

nuclearff::get_pbp_data +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using nflreadr::load_pbp()

+

load_pbp +Load play-by-play data

+

update_db +Update or Create a nflfastR Play-by-Play Database

+

load_nextgen_stats +Load player level weekly NFL Next Gen Stats

+

load_pfr_advstats +Load advanced stats from PFR

+
+
+

Author

+

Nolan MacDonald

+
+ +
+ + +
+ + + + + + + diff --git a/docs/reference/get_rb_ngs_advstats_season.html b/docs/reference/get_rb_ngs_advstats_season.html index e8659d8..ea953f8 100644 --- a/docs/reference/get_rb_ngs_advstats_season.html +++ b/docs/reference/get_rb_ngs_advstats_season.html @@ -43,6 +43,55 @@

Usage
get_rb_ngs_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 15 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0038120)

+ +
player_display_name
+

Player name (e.g., Breece Hall)

+ +
player_name
+

Player shortened name (e.g., B.Hall)

+ +
position
+

Player position

+ +
rush_attempts
+

Total rush attempts

+ +
rush_yards
+

Total rush yards

+ +
avg_rush_yards
+

Average rush yards per attempt

+ +
rush_touchdowns
+

Total rush touchdowns

+ +
efficiency
+

Average efficiency (EFF)

+ +
percent_attempts_gte_eight_defenders
+

Average % attempts with 8+ Defenders in the Box (8+D%)

+ +
avg_time_to_los
+

Average time behind line of scrimmage (TLOS)

+ +
expected_rush_yards
+

Average expected rush yards

+ +
rush_yards_over_expected
+

Average rush yards over expected

+ +
rush_yards_over_expected_per_att
+

Average rush yards over expected per attempt

+ +
rush_pct_over_expected
+

Average rush % over expected

+ + +

Arguments

@@ -76,24 +125,7 @@

See also

Author

Nolan MacDonald

-
  • player_idPlayer gsis id (e.g., 00-0038120)

  • -
  • player_display_namePlayer name (e.g., Breece Hall)

  • -
  • player_namePlayer shortened name (e.g., B.Hall)

  • -
  • positionPlayer position

  • -
  • rush_attemptsTotal rush attempts

  • -
  • rush_yardsTotal rush yards

  • -
  • avg_rush_yardsAverage rush yards per attempt

  • -
  • rush_touchdownsTotal rush touchdowns

  • -
  • efficiencyAverage efficiency (EFF)

  • -
  • percent_attempts_gte_eight_defenders -Average % attempts with 8+ Defenders in the Box (8+D%)

  • -
  • avg_time_to_losAverage time behind line of scrimmage (TLOS)

  • -
  • expected_rush_yardsAverage expected rush yards

  • -
  • rush_yards_over_expectedAverage rush yards over expected

  • -
  • rush_yards_over_expected_per_att -Average rush yards over expected per attempt

  • -
  • rush_pct_over_expectedAverage rush % over expected

  • -

+ diff --git a/docs/reference/get_rb_pbp_stats.html b/docs/reference/get_rb_pbp_stats.html index 29febb8..46aa3e8 100644 --- a/docs/reference/get_rb_pbp_stats.html +++ b/docs/reference/get_rb_pbp_stats.html @@ -43,12 +43,210 @@

Usage
get_rb_pbp_stats(
   pbp_db = NULL,
   pbp_db_tbl = NULL,
-  season = NULL,
+  seasons = NULL,
   week_min = NULL,
   week_max = NULL
 )
+
+

Format

+

A data frame with 59 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0038120)

+ +
player_display_name
+

Player name (e.g., Breece Hall)

+ +
player_name
+

Player shortened name (e.g., B.Hall)

+ +
position
+

Player position (e.g., RB)

+ +
team
+

Player team (e.g., NYJ)

+ +
games
+

Number of games played

+ +
fpts_std_4pt_td
+

Fantasy points for standard format with 4 point TD

+ +
ppg_std_4pt_td
+

Fantasy points per game for standard format with 4 point TD

+ +
fpts_half_ppr_4pt_td
+

Fantasy points for half PPR format with 4 point TD

+ +
ppg_half_ppr_4pt_td
+

Fantasy points per game for half PPR format with 4 point TD

+ +
fpts_ppr_4pt_td
+

Fantasy points for full PPR format with 4 point TD

+ +
ppg_ppr_4pt_td
+

Fantasy points per game for full PPR format with 4 point TD

+ +
fpts_std_6pt_td
+

Fantasy points for standard format with 6 point TD

+ +
ppg_std_6pt_td
+

Fantasy points per game for standard format with 6 point TD

+ +
fpts_half_ppr_6pt_td
+

Fantasy points for half PPR format with 6 point TD

+ +
ppg_half_ppr_6pt_td
+

Fantasy points per game for half PPR format with 6 point TD

+ +
fpts_ppr_6pt_td
+

Fantasy points for full PPR format with 6 point TD

+ +
ppg_ppr_6pt_td
+

Fantasy points per game for full PPR format with 6 point TD

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt

+ +
rushing_fumbles
+

Number of rushes with a fumble

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble

+ +
rushing_first_downs
+

Number of rushing first downs

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs

+ +
rushing_2pt_conversions
+

Two-point conversion rushes

+ +
targets
+

Number of pass plays where the player was targeted as a receiver

+ +
receptions
+

Number of pass receptions. Lateral receptions don't count as a reception

+ +
receiving_yards
+

Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play

+ +
receiving_tds
+

Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play

+ +
receiving_fumbles
+

Number of fumbles after a pass reception

+ +
receiving_fumbles_lost
+

Number of fumbles lost after a pass reception

+ +
receiving_air_yards
+

Receiving air yards including incomplete passes

+ +
receiving_yards_after_catch
+

Yards after the catch gained on plays in which player was receiver (this +is an unofficial stat and may differ slightly between different sources)

+ +
receiving_first_downs
+

Number of first downs gained on a reception

+ +
receiving_epa
+

Expected points added on receptions

+ +
receiving_2pt_conversions
+

Two-point conversion receptions

+ +
racr
+

Receiving Air Conversion Ratio. +RACR = receiving_yards / receiving_air_yards

+ +
target_share
+

Share of targets of player compared to all team targets

+ +
tgt_pct
+

Share of targets percentage

+ +
air_yards_share
+

Share of receiving_air_yards of the player to all team air_yards

+ +
wopr
+

Weighted Opportunity Rating. +WOPR = 1.5 x target_share + 0.7 x air_yards_share

+ +
completions
+

Total pass completions (CMP)

+ +
attempts
+

Total pass attempts (ATT)

+ +
cmp_pct
+

Pass completion percentage

+ +
passing_yards
+

Total passing yards

+ +
passing_tds
+

Total passing touchdowns

+ +
interceptions
+

Total pass interceptions (INT)

+ +
sacks
+

Total number of sacks taken

+ +
sack_yards
+

Total yards taken from sacks

+ +
sack_fumbles
+

Total fumbles from sacks

+ +
sack_fumbles_lost
+

Total fumbles lost from sacks

+ +
passing_air_yards
+

Passing air yards (includes incomplete passes)

+ +
passing_yards_after_catch
+

Yards after the catch gained on plays in which player was the passer +(this is an unofficial stat and may differ slightly between different +sources).

+ +
passing_first_downs
+

First downs on pass attempts

+ +
passing_epa
+

Total expected points added (EPA) on pass attempts and sacks. +NOTE: This uses the variable qb_epa, which gives QB credit for EPA for +up to the point where a receiver lost a fumble after a completed catch +and makes EPA work more like passing yards on plays with fumbles

+ +
passing_2pt_conversions
+

Two-point conversion passes

+ +
pacr
+

Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards

+ +
dakota
+

Adjusted EPA + CPOE composite based on coefficients which best predicts +adjusted EPA/play in the following year

+ + +

Arguments

@@ -57,8 +255,8 @@

Argumentsseason -

NFL season (required) to obtain play-by-play data. The +

seasons
+

NFL season(s) (required) to obtain play-by-play data. The season can be defined as a single season, season = 2024. For multiple seasons, use either season = c(2023,2024) or season = 2022:2024.

@@ -116,125 +314,16 @@

DetailsSee also

nuclearff::get_pbp_data Obtain play-by-play data for a specified time frame from either a saved -database or if not defined, using nflreadr::load_pbp(),

+database or if not defined, using nflreadr::load_pbp()

load_pbp -Load play-by-play data,

+Load play-by-play data

update_db Update or Create a nflfastR Play-by-Play Database

Author

Nolan MacDonald

-
+ diff --git a/docs/reference/get_rb_pfr_advstats_season.html b/docs/reference/get_rb_pfr_advstats_season.html index 51ab005..a29fc0b 100644 --- a/docs/reference/get_rb_pfr_advstats_season.html +++ b/docs/reference/get_rb_pfr_advstats_season.html @@ -43,6 +43,58 @@

Usage
get_rb_pfr_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 16 variables that are described below.

player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
age
+
+ +
position
+
+ +
g
+

Number of games played

+ +
gs
+

Number of games started

+ +
att
+

Total rush attempts

+ +
yds
+

Total rush yards

+ +
td
+

Total rush touchdowns

+ +
x1d
+

Rushing first downs

+ +
ybc
+

Rushing yards before contact

+ +
ybc_att
+

Rushing yards before contact per rushing attempt

+ +
yac
+

Rushing yards after contact

+ +
yac_att
+

Rushing yards after contact per attempt

+ +
brk_tkl
+

Broken tackles on rushes

+ +
att_br
+

Rush attempts per broken tackle

+ +
pfr_player_id
+

Pro Football Reference player ID (e.g., JackLa00)

+ + +

Arguments

@@ -75,24 +127,7 @@

See also

Author

Nolan MacDonald

-
  • player_display_namePlayer name (e.g., Lamar Jackson)

  • -
  • age

  • -
  • position

  • -
  • gNumber of games played

  • -
  • gsNumber of games started

  • -
  • attTotal rush attempts

  • -
  • ydsTotal rush yards

  • -
  • tdTotal rush touchdowns

  • -
  • x1dRushing first downs

  • -
  • ybcRushing yards before contact

  • -
  • ybc_attRushing yards before contact per rushing attempt

  • -
  • yacRushing yards after contact

  • -
  • yac_attRushing yards after contact per attempt

  • -
  • brk_tklBroken tackles on rushes

  • -
  • att_brRush attempts per broken tackle

  • -
  • pfr_player_id -Pro Football Reference player ID (e.g., JackLa00)

  • -

+ diff --git a/docs/reference/get_te_combined_stats_season.html b/docs/reference/get_te_combined_stats_season.html new file mode 100644 index 0000000..7194bba --- /dev/null +++ b/docs/reference/get_te_combined_stats_season.html @@ -0,0 +1,335 @@ + +TE Cumulative Season Advanced Stats — get_te_combined_stats_season • nuclearff + Skip to contents + + +
+
+
+ +
+

Obtain TE stats from NFL cumulative season stats for a specified time frame +from either a saved database or nflreadr::load_pbp(). The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR).

+
+ +
+

Usage

+
get_te_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)
+
+ +
+

Format

+

A data frame with 61 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0034796)

+ +
player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
player_name
+

Player shortened name (e.g., L.Jackson)

+ +
pos
+

Player position (e.g., QB)

+ +
tm
+

Player team (e.g., BAL)

+ +
g
+

Number of games played

+ +
tgt
+

Number of pass plays where the player was targeted as a receiver from +PBP data

+ +
rec
+

Number of pass receptions. Lateral receptions don't count as a reception +from PBP data

+ +
rec_yds
+

Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play from PBP data

+ +
rec_td
+

Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play from PBP data

+ +
avg_yac
+

Average yards after catch (YAC) from NGS

+ +
avg_expected_yac
+

Average expected yards after catch (xYAC) from NGS

+ +
avg_yac_above_expectation
+

Average yards after catch above expectation (+/-) from NGS

+ +
yac
+

Yards after catch (YAC) from PFR

+ +
yac_r
+

Yards after catch (YAC) per reception from PFR

+ +
adot
+

Average depth of target (ADOT) when targeted, whether completed or not, +from PFR

+ +
receiving_epa
+

Expected points added on receptions +from PBP data

+ +
racr
+

Receiving Air Conversion Ratio. +RACR = receiving_yards / receiving_air_yards from PBP

+ +
wopr
+

Weighted Opportunity Rating. +WOPR = 1.5 x target_share + 0.7 x air_yards_share from PBP data

+ +
avg_cushion
+

Average cushion (CUSH) from NGS

+ +
avg_separation
+

Average separation (SEP) from NGS

+ +
target_share
+

Share of targets of player compared to all team targets from PBP

+ +
tgt_pct
+

Share of targets percentage from PBP

+ +
ybc
+

Total yards passes traveled in the air before being caught or yards +before catch (YBC) from PFR

+ +
ybc_r
+

Yards before catch per reception from PFR

+ +
receiving_air
+

Receiving air yards including incomplete passes from PBP data

+ +
avg_intended_air_yards
+

Average targeted air yards (TAY) from NGS

+ +
percent_share_of_intended_air_yards
+

Average % share of team's air yards (TAY%) from NGS

+ +
air_yards_share
+

Share of receiving_air_yards of the player to all team air_yards +from PBP data

+ +
x1d_rec
+

Number of first downs gained on a reception from PBP data

+ +
brk_tkl
+

Number of broken tackles from PFR

+ +
rec_br
+

Receptions per broken tackle from PFR

+ +
drop
+

Number of dropped passes from PFR

+ +
drop_percent
+

Dropped pass percentage when targeted from PFR

+ +
catch_percentage
+

Average catch percentage from NGS

+ +
receiving_fumbles
+

Number of fumbles after a pass reception +from PBP data

+ +
receiving_fumbles_lost
+

Number of fumbles lost after a pass reception from PBP data

+ +
receiving_2pt_conversions
+

Two-point conversion receptions from PBP data

+ +
int_tgt
+

Interceptions on passes where targetedfrom PFR

+ +
rat
+

Passer rating on passes when targeted from PFR

+ +
fpts_std_4pt_td
+

Fantasy points for standard format with 4 point TD

+ +
ppg_std_4pt_td
+

Fantasy points per game for standard format with 4 point TD

+ +
fpts_half_ppr_4pt_td
+

Fantasy points for half PPR format with 4 point TD

+ +
ppg_half_ppr_4pt_td
+

Fantasy points per game for half PPR format with 4 point TD

+ +
fpts_ppr_4pt_td
+

Fantasy points for full PPR format with 4 point TD

+ +
ppg_ppr_4pt_td
+

Fantasy points per game for full PPR format with 4 point TD

+ +
fpts_std_6pt_td
+

Fantasy points for standard format with 6 point TD

+ +
ppg_std_6pt_td
+

Fantasy points per game for standard format with 6 point TD

+ +
fpts_half_ppr_6pt_td
+

Fantasy points for half PPR format with 6 point TD

+ +
ppg_half_ppr_6pt_td
+

Fantasy points per game for half PPR format with 6 point TD

+ +
fpts_ppr_6pt_td
+

Fantasy points for full PPR format with 6 point TD

+ +
ppg_ppr_6pt_td
+

Fantasy points per game for full PPR format with 6 point TD

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data

+ +
rushing_fumbles
+

Number of rushes with a fumble from PBP data

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble from PBP data

+ +
rushing_first_downs
+

Number of rushing first downs from PBP data

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data

+ +
rushing_2pt_conversions
+

Two-point conversion rushes from PBP data

+ +
pfr_id
+

Pro Football Reference player ID (e.g., JackLa00)

+ + +
+
+

Arguments

+ + +
pbp_db_tbl
+

Play-by-Play database table name (optional)

+ + +
seasons
+

NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, season = 2024. For multiple +seasons, use either season = c(2023,2024) or season = 2022:2024.

+ + +
pbp_dp
+

Play-by-Play database path (optional)

+ +
+
+

Value

+

Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR)

+
+
+

Details

+

The function get_te_combined_stats_season can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the nflfastR function calculate_player_stats(). +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using nflreadr::load_pbp(). +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +nflreadr function load_nextgen_stats to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, seasons must be 2018 or later.

+
+
+

See also

+

nuclearff::get_pbp_data +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using nflreadr::load_pbp()

+

load_pbp +Load play-by-play data

+

update_db +Update or Create a nflfastR Play-by-Play Database

+

load_nextgen_stats +Load player level weekly NFL Next Gen Stats

+

load_pfr_advstats +Load advanced stats from PFR

+
+
+

Author

+

Nolan MacDonald

+
+ +
+ + +
+ + + + + + + diff --git a/docs/reference/get_te_ngs_advstats_season.html b/docs/reference/get_te_ngs_advstats_season.html index 7c78108..013f4e5 100644 --- a/docs/reference/get_te_ngs_advstats_season.html +++ b/docs/reference/get_te_ngs_advstats_season.html @@ -43,6 +43,58 @@

Usage
get_te_ngs_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 16 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0037744)

+ +
player_display_name
+

Player name (e.g., Trey McBride)

+ +
player_name
+

Player shortened name (e.g., T.McBride)

+ +
position
+

Player position

+ +
targets
+

Total receiving targets

+ +
receptions
+

Total receptions

+ +
yards
+

Total receiving yards

+ +
rec_touchdowns
+

Total reception touchdowns

+ +
avg_cushion
+

Average cushion (CUSH)

+ +
avg_separation
+

Average separation (SEP)

+ +
avg_intended_air_yards
+

Average targeted air yards (TAY)

+ +
avg_percent_share_of_intended_air_yards
+

Average % share of team's air yards (TAY%)

+ +
avg_catch_percentage
+

Average catch percentage

+ +
avg_yac
+

Average yards after catch (YAC)

+ +
avg_expected_yac
+

Average expected yards after catch (xYAC)

+ +
avg_yac_above_expectation
+

Average yards after catch above expectation (+/-)

+ + +

Arguments

@@ -76,25 +128,7 @@

See also

Author

Nolan MacDonald

-
  • player_idPlayer gsis id (e.g., 00-0037744)

  • -
  • player_display_namePlayer name (e.g., Trey McBride)

  • -
  • player_namePlayer shortened name (e.g., T.McBride)

  • -
  • positionPlayer position

  • -
  • targetsTotal receiving targets

  • -
  • receptionsTotal receptions

  • -
  • yardsTotal receiving yards

  • -
  • rec_touchdownsTotal reception touchdowns

  • -
  • avg_cushionAverage cushion (CUSH)

  • -
  • avg_separationAverage separation (SEP)

  • -
  • avg_intended_air_yardsAverage targeted air yards (TAY)

  • -
  • avg_percent_share_of_intended_air_yards -Average % share of team's air yards (TAY%)

  • -
  • avg_catch_percentageAverage catch percentage

  • -
  • avg_yacAverage yards after catch (YAC)

  • -
  • avg_expected_yacAverage expected yards after catch (xYAC)

  • -
  • avg_yac_above_expectation -Average yards after catch above expectation (+/-)

  • -

+ diff --git a/docs/reference/get_te_pbp_stats.html b/docs/reference/get_te_pbp_stats.html index 68d5ee1..410bbaa 100644 --- a/docs/reference/get_te_pbp_stats.html +++ b/docs/reference/get_te_pbp_stats.html @@ -43,12 +43,210 @@

Usage
get_te_pbp_stats(
   pbp_db = NULL,
   pbp_db_tbl = NULL,
-  season = NULL,
+  seasons = NULL,
   week_min = NULL,
   week_max = NULL
 )
+
+

Format

+

A data frame with 59 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0038120)

+ +
player_display_name
+

Player name (e.g., Breece Hall)

+ +
player_name
+

Player shortened name (e.g., B.Hall)

+ +
position
+

Player position (e.g., RB)

+ +
team
+

Player team (e.g., NYJ)

+ +
games
+

Number of games played

+ +
fpts_std_4pt_td
+

Fantasy points for standard format with 4 point TD

+ +
ppg_std_4pt_td
+

Fantasy points per game for standard format with 4 point TD

+ +
fpts_half_ppr_4pt_td
+

Fantasy points for half PPR format with 4 point TD

+ +
ppg_half_ppr_4pt_td
+

Fantasy points per game for half PPR format with 4 point TD

+ +
fpts_ppr_4pt_td
+

Fantasy points for full PPR format with 4 point TD

+ +
ppg_ppr_4pt_td
+

Fantasy points per game for full PPR format with 4 point TD

+ +
fpts_std_6pt_td
+

Fantasy points for standard format with 6 point TD

+ +
ppg_std_6pt_td
+

Fantasy points per game for standard format with 6 point TD

+ +
fpts_half_ppr_6pt_td
+

Fantasy points for half PPR format with 6 point TD

+ +
ppg_half_ppr_6pt_td
+

Fantasy points per game for half PPR format with 6 point TD

+ +
fpts_ppr_6pt_td
+

Fantasy points for full PPR format with 6 point TD

+ +
ppg_ppr_6pt_td
+

Fantasy points per game for full PPR format with 6 point TD

+ +
targets
+

Number of pass plays where the player was targeted as a receiver

+ +
receptions
+

Number of pass receptions. Lateral receptions don't count as a reception

+ +
receiving_yards
+

Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play

+ +
receiving_tds
+

Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play

+ +
receiving_fumbles
+

Number of fumbles after a pass reception

+ +
receiving_fumbles_lost
+

Number of fumbles lost after a pass reception

+ +
receiving_air_yards
+

Receiving air yards including incomplete passes

+ +
receiving_yards_after_catch
+

Yards after the catch gained on plays in which player was receiver (this +is an unofficial stat and may differ slightly between different sources)

+ +
receiving_first_downs
+

Number of first downs gained on a reception

+ +
receiving_epa
+

Expected points added on receptions

+ +
receiving_2pt_conversions
+

Two-point conversion receptions

+ +
racr
+

Receiving Air Conversion Ratio. +RACR = receiving_yards / receiving_air_yards

+ +
target_share
+

Share of targets of player compared to all team targets

+ +
tgt_pct
+

Share of targets percentage

+ +
air_yards_share
+

Share of receiving_air_yards of the player to all team air_yards

+ +
wopr
+

Weighted Opportunity Rating. +WOPR = 1.5 x target_share + 0.7 x air_yards_share

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt

+ +
rushing_fumbles
+

Number of rushes with a fumble

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble

+ +
rushing_first_downs
+

Number of rushing first downs

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs

+ +
rushing_2pt_conversions
+

Two-point conversion rushes

+ +
completions
+

Total pass completions (CMP)

+ +
attempts
+

Total pass attempts (ATT)

+ +
cmp_pct
+

Pass completion percentage

+ +
passing_yards
+

Total passing yards

+ +
passing_tds
+

Total passing touchdowns

+ +
interceptions
+

Total pass interceptions (INT)

+ +
sacks
+

Total number of sacks taken

+ +
sack_yards
+

Total yards taken from sacks

+ +
sack_fumbles
+

Total fumbles from sacks

+ +
sack_fumbles_lost
+

Total fumbles lost from sacks

+ +
passing_air_yards
+

Passing air yards (includes incomplete passes)

+ +
passing_yards_after_catch
+

Yards after the catch gained on plays in which player was the passer +(this is an unofficial stat and may differ slightly between different +sources).

+ +
passing_first_downs
+

First downs on pass attempts

+ +
passing_epa
+

Total expected points added (EPA) on pass attempts and sacks. +NOTE: This uses the variable qb_epa, which gives QB credit for EPA for +up to the point where a receiver lost a fumble after a completed catch +and makes EPA work more like passing yards on plays with fumbles

+ +
passing_2pt_conversions
+

Two-point conversion passes

+ +
pacr
+

Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards

+ +
dakota
+

Adjusted EPA + CPOE composite based on coefficients which best predicts +adjusted EPA/play in the following year

+ + +

Arguments

@@ -57,8 +255,8 @@

Argumentsseason -

NFL season (required) to obtain play-by-play data. The +

seasons
+

NFL season(s) (required) to obtain play-by-play data. The season can be defined as a single season, season = 2024. For multiple seasons, use either season = c(2023,2024) or season = 2022:2024.

@@ -114,127 +312,18 @@

Details

See also

-

nuclearff::get_pbp_data: +

nuclearff::get_pbp_data Obtain play-by-play data for a specified time frame from either a saved -database or if not defined, using nflreadr::load_pbp(),

+database or if not defined, using nflreadr::load_pbp()

load_pbp -Load play-by-play data,

+Load play-by-play data

update_db Update or Create a nflfastR Play-by-Play Database

Author

Nolan MacDonald

-
  • player_idPlayer gsis id (e.g., 00-0038120)

  • -
  • player_display_namePlayer name (e.g., Breece Hall)

  • -
  • player_namePlayer shortened name (e.g., B.Hall)

  • -
  • positionPlayer position (e.g., RB)

  • -
  • teamPlayer team (e.g., NYJ)

  • -
  • gamesNumber of games played

  • -
  • fpts_std_4pt_td -Fantasy points for standard format with 4 point TD

  • -
  • ppg_std_4pt_td -Fantasy points per game for standard format with 4 point TD

  • -
  • fpts_half_ppr_4pt_td -Fantasy points for half PPR format with 4 point TD

  • -
  • ppg_half_ppr_4pt_td -Fantasy points per game for half PPR format with 4 point TD

  • -
  • fpts_ppr_4pt_td -Fantasy points for full PPR format with 4 point TD

  • -
  • ppg_ppr_4pt_td -Fantasy points per game for full PPR format with 4 point TD

  • -
  • fpts_std_6pt_td -Fantasy points for standard format with 6 point TD

  • -
  • ppg_std_6pt_td -Fantasy points per game for standard format with 6 point TD

  • -
  • fpts_half_ppr_6pt_td -Fantasy points for half PPR format with 6 point TD

  • -
  • ppg_half_ppr_6pt_td -Fantasy points per game for half PPR format with 6 point TD

  • -
  • fpts_ppr_6pt_td -Fantasy points for full PPR format with 6 point TD

  • -
  • ppg_ppr_6pt_td -Fantasy points per game for full PPR format with 6 point TD

  • -
  • targets -Number of pass plays where the player was targeted as a receiver

  • -
  • receptions -Number of pass receptions. Lateral receptions don't count as a reception

  • -
  • receiving_yards -Yards gained after a pass reception. Includes yards gained after -receiving a lateral on a play that started as a pass play

  • -
  • receiving_tds -Number of reception touchdowns, including after receiving a lateral on a -play that began as a pass play

  • -
  • receiving_fumblesNumber of fumbles after a pass reception

  • -
  • receiving_fumbles_lost -Number of fumbles lost after a pass reception

  • -
  • receiving_air_yards -Receiving air yards including incomplete passes

  • -
  • receiving_yards_after_catch -Yards after the catch gained on plays in which player was receiver (this -is an unofficial stat and may differ slightly between different sources)

  • -
  • receiving_first_downs -Number of first downs gained on a reception

  • -
  • receiving_epaExpected points added on receptions

  • -
  • receiving_2pt_conversionsTwo-point conversion receptions

  • -
  • racr -Receiving Air Conversion Ratio. -RACR = receiving_yards / receiving_air_yards

  • -
  • target_share -Share of targets of player compared to all team targets

  • -
  • tgt_pctShare of targets percentage

  • -
  • air_yards_share -Share of receiving_air_yards of the player to all team air_yards

  • -
  • wopr -Weighted Opportunity Rating. -WOPR = 1.5 x target_share + 0.7 x air_yards_share

  • -
  • carries -Number of rush attempts including scrambles and kneel downs. Rushes after -a lateral reception don't count as a carry

  • -
  • rushing_yards -Yards gained when rushing including scrambles and kneel downs. Also -includes yards gained after obtaining a lateral on a play that started -with a rushing attempt

  • -
  • rushing_tds -The number of rushing touchdowns (incl. scrambles). Also includes -touchdowns after obtaining a lateral on a play that started with a -rushing attempt

  • -
  • rushing_fumblesNumber of rushes with a fumble

  • -
  • rushing_fumbles_lostNumber of rushes with a lost fumble

  • -
  • rushing_first_downsNumber of rushing first downs

  • -
  • rushing_epa -Expected points added (EPA) on rush attempts including scrambles and -kneel downs

  • -
  • rushing_2pt_conversionsTwo-point conversion rushes

  • -
  • completionsTotal pass completions (CMP)

  • -
  • attemptsTotal pass attempts (ATT)

  • -
  • cmp_pctPass completion percentage

  • -
  • passing_yardsTotal passing yards

  • -
  • passing_tdsTotal passing touchdowns

  • -
  • interceptionsTotal pass interceptions (INT)

  • -
  • sacksTotal number of sacks taken

  • -
  • sack_yardsTotal yards taken from sacks

  • -
  • sack_fumblesTotal fumbles from sacks

  • -
  • sack_fumbles_lostTotal fumbles lost from sacks

  • -
  • passing_air_yards -Passing air yards (includes incomplete passes)

  • -
  • passing_yards_after_catch -Yards after the catch gained on plays in which player was the passer -(this is an unofficial stat and may differ slightly between different -sources).

  • -
  • passing_first_downsFirst downs on pass attempts

  • -
  • passing_epa -Total expected points added (EPA) on pass attempts and sacks. -NOTE: This uses the variable qb_epa, which gives QB credit for EPA for -up to the point where a receiver lost a fumble after a completed catch -and makes EPA work more like passing yards on plays with fumbles

  • -
  • passing_2pt_conversionsTwo-point conversion passes

  • -
  • pacr -Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards

  • -
  • dakota -Adjusted EPA + CPOE composite based on coefficients which best predicts -adjusted EPA/play in the following year

  • -
+

diff --git a/docs/reference/get_te_pfr_advstats_season.html b/docs/reference/get_te_pfr_advstats_season.html index 999684a..d73caab 100644 --- a/docs/reference/get_te_pfr_advstats_season.html +++ b/docs/reference/get_te_pfr_advstats_season.html @@ -43,6 +43,77 @@

Usage
get_te_pfr_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 22 variables that are described below.

player_display_name
+

Player name (e.g., George Kittle)

+ +
age
+

Player age

+ +
position
+

Player position

+ +
g
+

Number of games played

+ +
gs
+

Number of games started

+ +
tgt
+

Total targets

+ +
rec
+

Total receptions

+ +
yds
+

Total receiving yards

+ +
td
+

Total receiving touchdowns

+ +
x1d
+

First downs receiving

+ +
ybc
+

Total yards passes traveled in the air before being caught or yards +before catch (YBC)

+ +
ybc_r
+

Yards before catch per reception

+ +
yac
+

Yards after catch (YAC)

+ +
yac_r
+

Yards after catch (YAC) per reception

+ +
adot
+

Average depth of target (ADOT) when targeted, whether completed or not.

+ +
brk_tkl
+

Number of broken tackles

+ +
rec_br
+

Receptions per broken tackle

+ +
drop
+

Number of dropped passes

+ +
drop_percent
+

Dropped pass percentage when targeted

+ +
int_tgt
+

Interceptions on passes where targeted

+ +
rat
+

Passer rating on passes when targeted

+ +
pfr_player_id
+

Pro Football Reference player ID (e.g., KittGe00)

+ + +

Arguments

@@ -75,33 +146,7 @@

See also

Author

Nolan MacDonald

-
  • player_display_namePlayer name (e.g., George Kittle)

  • -
  • agePlayer age

  • -
  • positionPlayer position

  • -
  • gNumber of games played

  • -
  • gsNumber of games started

  • -
  • tgtTotal targets

  • -
  • recTotal receptions

  • -
  • ydsTotal receiving yards

  • -
  • tdTotal receiving touchdowns

  • -
  • x1dFirst downs receiving

  • -
  • ybc -Total yards passes traveled in the air before being caught or yards -before catch (YBC)

  • -
  • ybc_rYards before catch per reception

  • -
  • yacYards after catch (YAC)

  • -
  • yac_rYards after catch (YAC) per reception

  • -
  • adot -Average depth of target (ADOT) when targeted, whether completed or not.

  • -
  • brk_tklNumber of broken tackles

  • -
  • rec_brReceptions per broken tackle

  • -
  • dropNumber of dropped passes

  • -
  • drop_percentDropped pass percentage when targeted

  • -
  • int_tgtInterceptions on passes where targeted

  • -
  • ratPasser rating on passes when targeted

  • -
  • pfr_player_id -Pro Football Reference player ID (e.g., KittGe00)

  • -

+ diff --git a/docs/reference/get_wr_combined_stats_season.html b/docs/reference/get_wr_combined_stats_season.html new file mode 100644 index 0000000..0ed0ddd --- /dev/null +++ b/docs/reference/get_wr_combined_stats_season.html @@ -0,0 +1,335 @@ + +WR Cumulative Season Advanced Stats — get_wr_combined_stats_season • nuclearff + Skip to contents + + +
+
+
+ +
+

Obtain WR stats from NFL cumulative season stats for a specified time frame +from either a saved database or nflreadr::load_pbp(). The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR).

+
+ +
+

Usage

+
get_wr_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)
+
+ +
+

Format

+

A data frame with 61 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0034796)

+ +
player_display_name
+

Player name (e.g., Lamar Jackson)

+ +
player_name
+

Player shortened name (e.g., L.Jackson)

+ +
pos
+

Player position (e.g., QB)

+ +
tm
+

Player team (e.g., BAL)

+ +
g
+

Number of games played

+ +
tgt
+

Number of pass plays where the player was targeted as a receiver from +PBP data

+ +
rec
+

Number of pass receptions. Lateral receptions don't count as a reception +from PBP data

+ +
rec_yds
+

Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play from PBP data

+ +
rec_td
+

Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play from PBP data

+ +
avg_yac
+

Average yards after catch (YAC) from NGS

+ +
avg_expected_yac
+

Average expected yards after catch (xYAC) from NGS

+ +
avg_yac_above_expectation
+

Average yards after catch above expectation (+/-) from NGS

+ +
yac
+

Yards after catch (YAC) from PFR

+ +
yac_r
+

Yards after catch (YAC) per reception from PFR

+ +
adot
+

Average depth of target (ADOT) when targeted, whether completed or not, +from PFR

+ +
receiving_epa
+

Expected points added on receptions +from PBP data

+ +
racr
+

Receiving Air Conversion Ratio. +RACR = receiving_yards / receiving_air_yards from PBP

+ +
wopr
+

Weighted Opportunity Rating. +WOPR = 1.5 x target_share + 0.7 x air_yards_share from PBP data

+ +
avg_cushion
+

Average cushion (CUSH) from NGS

+ +
avg_separation
+

Average separation (SEP) from NGS

+ +
target_share
+

Share of targets of player compared to all team targets from PBP

+ +
tgt_pct
+

Share of targets percentage from PBP

+ +
ybc
+

Total yards passes traveled in the air before being caught or yards +before catch (YBC) from PFR

+ +
ybc_r
+

Yards before catch per reception from PFR

+ +
receiving_air
+

Receiving air yards including incomplete passes from PBP data

+ +
avg_intended_air_yards
+

Average targeted air yards (TAY) from NGS

+ +
percent_share_of_intended_air_yards
+

Average % share of team's air yards (TAY%) from NGS

+ +
air_yards_share
+

Share of receiving_air_yards of the player to all team air_yards +from PBP data

+ +
x1d_rec
+

Number of first downs gained on a reception from PBP data

+ +
brk_tkl
+

Number of broken tackles from PFR

+ +
rec_br
+

Receptions per broken tackle from PFR

+ +
drop
+

Number of dropped passes from PFR

+ +
drop_percent
+

Dropped pass percentage when targeted from PFR

+ +
catch_percentage
+

Average catch percentage from NGS

+ +
receiving_fumbles
+

Number of fumbles after a pass reception +from PBP data

+ +
receiving_fumbles_lost
+

Number of fumbles lost after a pass reception from PBP data

+ +
receiving_2pt_conversions
+

Two-point conversion receptions from PBP data

+ +
int_tgt
+

Interceptions on passes where targetedfrom PFR

+ +
rat
+

Passer rating on passes when targeted from PFR

+ +
fpts_std_4pt_td
+

Fantasy points for standard format with 4 point TD

+ +
ppg_std_4pt_td
+

Fantasy points per game for standard format with 4 point TD

+ +
fpts_half_ppr_4pt_td
+

Fantasy points for half PPR format with 4 point TD

+ +
ppg_half_ppr_4pt_td
+

Fantasy points per game for half PPR format with 4 point TD

+ +
fpts_ppr_4pt_td
+

Fantasy points for full PPR format with 4 point TD

+ +
ppg_ppr_4pt_td
+

Fantasy points per game for full PPR format with 4 point TD

+ +
fpts_std_6pt_td
+

Fantasy points for standard format with 6 point TD

+ +
ppg_std_6pt_td
+

Fantasy points per game for standard format with 6 point TD

+ +
fpts_half_ppr_6pt_td
+

Fantasy points for half PPR format with 6 point TD

+ +
ppg_half_ppr_6pt_td
+

Fantasy points per game for half PPR format with 6 point TD

+ +
fpts_ppr_6pt_td
+

Fantasy points for full PPR format with 6 point TD

+ +
ppg_ppr_6pt_td
+

Fantasy points per game for full PPR format with 6 point TD

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data

+ +
rushing_fumbles
+

Number of rushes with a fumble from PBP data

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble from PBP data

+ +
rushing_first_downs
+

Number of rushing first downs from PBP data

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data

+ +
rushing_2pt_conversions
+

Two-point conversion rushes from PBP data

+ +
pfr_id
+

Pro Football Reference player ID (e.g., JackLa00)

+ + +
+
+

Arguments

+ + +
pbp_db_tbl
+

Play-by-Play database table name (optional)

+ + +
seasons
+

NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, season = 2024. For multiple +seasons, use either season = c(2023,2024) or season = 2022:2024.

+ + +
pbp_dp
+

Play-by-Play database path (optional)

+ +
+
+

Value

+

Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR)

+
+
+

Details

+

The function get_wr_combined_stats_season can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the nflfastR function calculate_player_stats(). +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using nflreadr::load_pbp(). +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +nflreadr function load_nextgen_stats to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, seasons must be 2018 or later.

+
+
+

See also

+

nuclearff::get_pbp_data +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using nflreadr::load_pbp()

+

load_pbp +Load play-by-play data

+

update_db +Update or Create a nflfastR Play-by-Play Database

+

load_nextgen_stats +Load player level weekly NFL Next Gen Stats

+

load_pfr_advstats +Load advanced stats from PFR

+
+
+

Author

+

Nolan MacDonald

+
+ +
+ + +
+ + + + + + + diff --git a/docs/reference/get_wr_ngs_advstats_season.html b/docs/reference/get_wr_ngs_advstats_season.html index e00f25c..cd2ad9f 100644 --- a/docs/reference/get_wr_ngs_advstats_season.html +++ b/docs/reference/get_wr_ngs_advstats_season.html @@ -43,6 +43,58 @@

Usage
get_wr_ngs_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 16 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0039337)

+ +
player_display_name
+

Player name (e.g., Malik Nabers)

+ +
player_name
+

Player shortened name (e.g., M.Nabers)

+ +
position
+

Player position

+ +
targets
+

Total receiving targets

+ +
receptions
+

Total receptions

+ +
yards
+

Total receiving yards

+ +
rec_touchdowns
+

Total reception touchdowns

+ +
avg_cushion
+

Average cushion (CUSH)

+ +
avg_separation
+

Average separation (SEP)

+ +
avg_intended_air_yards
+

Average targeted air yards (TAY)

+ +
percent_share_of_intended_air_yards
+

Average % share of team's air yards (TAY%)

+ +
catch_percentage
+

Average catch percentage

+ +
avg_yac
+

Average yards after catch (YAC)

+ +
avg_expected_yac
+

Average expected yards after catch (xYAC)

+ +
avg_yac_above_expectation
+

Average yards after catch above expectation (+/-)

+ + +

Arguments

@@ -76,25 +128,7 @@

See also

Author

Nolan MacDonald

-
  • player_idPlayer gsis id (e.g., 00-0039337)

  • -
  • player_display_namePlayer name (e.g., Malik Nabers)

  • -
  • player_namePlayer shortened name (e.g., M.Nabers)

  • -
  • positionPlayer position

  • -
  • targetsTotal receiving targets

  • -
  • receptionsTotal receptions

  • -
  • yardsTotal receiving yards

  • -
  • rec_touchdownsTotal reception touchdowns

  • -
  • avg_cushionAverage cushion (CUSH)

  • -
  • avg_separationAverage separation (SEP)

  • -
  • avg_intended_air_yardsAverage targeted air yards (TAY)

  • -
  • avg_percent_share_of_intended_air_yards -Average % share of team's air yards (TAY%)

  • -
  • avg_catch_percentageAverage catch percentage

  • -
  • avg_yacAverage yards after catch (YAC)

  • -
  • avg_expected_yacAverage expected yards after catch (xYAC)

  • -
  • avg_yac_above_expectation -Average yards after catch above expectation (+/-)

  • -

+ diff --git a/docs/reference/get_wr_pbp_stats.html b/docs/reference/get_wr_pbp_stats.html index c03aa7d..ebb5dfd 100644 --- a/docs/reference/get_wr_pbp_stats.html +++ b/docs/reference/get_wr_pbp_stats.html @@ -43,12 +43,210 @@

Usage
get_wr_pbp_stats(
   pbp_db = NULL,
   pbp_db_tbl = NULL,
-  season = NULL,
+  seasons = NULL,
   week_min = NULL,
   week_max = NULL
 )
+
+

Format

+

A data frame with 59 variables that are described below.

player_id
+

Player gsis id (e.g., 00-0038120)

+ +
player_display_name
+

Player name (e.g., Breece Hall)

+ +
player_name
+

Player shortened name (e.g., B.Hall)

+ +
position
+

Player position (e.g., RB)

+ +
team
+

Player team (e.g., NYJ)

+ +
games
+

Number of games played

+ +
fpts_std_4pt_td
+

Fantasy points for standard format with 4 point TD

+ +
ppg_std_4pt_td
+

Fantasy points per game for standard format with 4 point TD

+ +
fpts_half_ppr_4pt_td
+

Fantasy points for half PPR format with 4 point TD

+ +
ppg_half_ppr_4pt_td
+

Fantasy points per game for half PPR format with 4 point TD

+ +
fpts_ppr_4pt_td
+

Fantasy points for full PPR format with 4 point TD

+ +
ppg_ppr_4pt_td
+

Fantasy points per game for full PPR format with 4 point TD

+ +
fpts_std_6pt_td
+

Fantasy points for standard format with 6 point TD

+ +
ppg_std_6pt_td
+

Fantasy points per game for standard format with 6 point TD

+ +
fpts_half_ppr_6pt_td
+

Fantasy points for half PPR format with 6 point TD

+ +
ppg_half_ppr_6pt_td
+

Fantasy points per game for half PPR format with 6 point TD

+ +
fpts_ppr_6pt_td
+

Fantasy points for full PPR format with 6 point TD

+ +
ppg_ppr_6pt_td
+

Fantasy points per game for full PPR format with 6 point TD

+ +
targets
+

Number of pass plays where the player was targeted as a receiver

+ +
receptions
+

Number of pass receptions. Lateral receptions don't count as a reception

+ +
receiving_yards
+

Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play

+ +
receiving_tds
+

Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play

+ +
receiving_fumbles
+

Number of fumbles after a pass reception

+ +
receiving_fumbles_lost
+

Number of fumbles lost after a pass reception

+ +
receiving_air_yards
+

Receiving air yards including incomplete passes

+ +
receiving_yards_after_catch
+

Yards after the catch gained on plays in which player was receiver (this +is an unofficial stat and may differ slightly between different sources)

+ +
receiving_first_downs
+

Number of first downs gained on a reception

+ +
receiving_epa
+

Expected points added on receptions

+ +
receiving_2pt_conversions
+

Two-point conversion receptions

+ +
racr
+

Receiving Air Conversion Ratio. +RACR = receiving_yards / receiving_air_yards

+ +
target_share
+

Share of targets of player compared to all team targets

+ +
tgt_pct
+

Share of targets percentage

+ +
air_yards_share
+

Share of receiving_air_yards of the player to all team air_yards

+ +
wopr
+

Weighted Opportunity Rating. +WOPR = 1.5 x target_share + 0.7 x air_yards_share

+ +
carries
+

Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry

+ +
rushing_yards
+

Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt

+ +
rushing_tds
+

The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt

+ +
rushing_fumbles
+

Number of rushes with a fumble

+ +
rushing_fumbles_lost
+

Number of rushes with a lost fumble

+ +
rushing_first_downs
+

Number of rushing first downs

+ +
rushing_epa
+

Expected points added (EPA) on rush attempts including scrambles and +kneel downs

+ +
rushing_2pt_conversions
+

Two-point conversion rushes

+ +
completions
+

Total pass completions (CMP)

+ +
attempts
+

Total pass attempts (ATT)

+ +
cmp_pct
+

Pass completion percentage

+ +
passing_yards
+

Total passing yards

+ +
passing_tds
+

Total passing touchdowns

+ +
interceptions
+

Total pass interceptions (INT)

+ +
sacks
+

Total number of sacks taken

+ +
sack_yards
+

Total yards taken from sacks

+ +
sack_fumbles
+

Total fumbles from sacks

+ +
sack_fumbles_lost
+

Total fumbles lost from sacks

+ +
passing_air_yards
+

Passing air yards (includes incomplete passes)

+ +
passing_yards_after_catch
+

Yards after the catch gained on plays in which player was the passer +(this is an unofficial stat and may differ slightly between different +sources).

+ +
passing_first_downs
+

First downs on pass attempts

+ +
passing_epa
+

Total expected points added (EPA) on pass attempts and sacks. +NOTE: This uses the variable qb_epa, which gives QB credit for EPA for +up to the point where a receiver lost a fumble after a completed catch +and makes EPA work more like passing yards on plays with fumbles

+ +
passing_2pt_conversions
+

Two-point conversion passes

+ +
pacr
+

Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards

+ +
dakota
+

Adjusted EPA + CPOE composite based on coefficients which best predicts +adjusted EPA/play in the following year

+ + +

Arguments

@@ -57,8 +255,8 @@

Argumentsseason -

NFL season (required) to obtain play-by-play data. The +

seasons
+

NFL season(s) (required) to obtain play-by-play data. The season can be defined as a single season, season = 2024. For multiple seasons, use either season = c(2023,2024)

@@ -114,123 +312,18 @@

Details

See also

- +

nuclearff::get_pbp_data +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using nflreadr::load_pbp()

+

load_pbp +Load play-by-play data

+

update_db +Update or Create a nflfastR Play-by-Play Database

Author

Nolan MacDonald

-
  • player_idPlayer gsis id (e.g., 00-0038120)

  • -
  • player_display_namePlayer name (e.g., Breece Hall)

  • -
  • player_namePlayer shortened name (e.g., B.Hall)

  • -
  • positionPlayer position (e.g., RB)

  • -
  • teamPlayer team (e.g., NYJ)

  • -
  • gamesNumber of games played

  • -
  • fpts_std_4pt_td -Fantasy points for standard format with 4 point TD

  • -
  • ppg_std_4pt_td -Fantasy points per game for standard format with 4 point TD

  • -
  • fpts_half_ppr_4pt_td -Fantasy points for half PPR format with 4 point TD

  • -
  • ppg_half_ppr_4pt_td -Fantasy points per game for half PPR format with 4 point TD

  • -
  • fpts_ppr_4pt_td -Fantasy points for full PPR format with 4 point TD

  • -
  • ppg_ppr_4pt_td -Fantasy points per game for full PPR format with 4 point TD

  • -
  • fpts_std_6pt_td -Fantasy points for standard format with 6 point TD

  • -
  • ppg_std_6pt_td -Fantasy points per game for standard format with 6 point TD

  • -
  • fpts_half_ppr_6pt_td -Fantasy points for half PPR format with 6 point TD

  • -
  • ppg_half_ppr_6pt_td -Fantasy points per game for half PPR format with 6 point TD

  • -
  • fpts_ppr_6pt_td -Fantasy points for full PPR format with 6 point TD

  • -
  • ppg_ppr_6pt_td -Fantasy points per game for full PPR format with 6 point TD

  • -
  • targets -Number of pass plays where the player was targeted as a receiver

  • -
  • receptions -Number of pass receptions. Lateral receptions don't count as a reception

  • -
  • receiving_yards -Yards gained after a pass reception. Includes yards gained after -receiving a lateral on a play that started as a pass play

  • -
  • receiving_tds -Number of reception touchdowns, including after receiving a lateral on a -play that began as a pass play

  • -
  • receiving_fumblesNumber of fumbles after a pass reception

  • -
  • receiving_fumbles_lost -Number of fumbles lost after a pass reception

  • -
  • receiving_air_yards -Receiving air yards including incomplete passes

  • -
  • receiving_yards_after_catch -Yards after the catch gained on plays in which player was receiver (this -is an unofficial stat and may differ slightly between different sources)

  • -
  • receiving_first_downs -Number of first downs gained on a reception

  • -
  • receiving_epaExpected points added on receptions

  • -
  • receiving_2pt_conversionsTwo-point conversion receptions

  • -
  • racr -Receiving Air Conversion Ratio. -RACR = receiving_yards / receiving_air_yards

  • -
  • target_share -Share of targets of player compared to all team targets

  • -
  • tgt_pctShare of targets percentage

  • -
  • air_yards_share -Share of receiving_air_yards of the player to all team air_yards

  • -
  • wopr -Weighted Opportunity Rating. -WOPR = 1.5 x target_share + 0.7 x air_yards_share

  • -
  • carries -Number of rush attempts including scrambles and kneel downs. Rushes after -a lateral reception don't count as a carry

  • -
  • rushing_yards -Yards gained when rushing including scrambles and kneel downs. Also -includes yards gained after obtaining a lateral on a play that started -with a rushing attempt

  • -
  • rushing_tds -The number of rushing touchdowns (incl. scrambles). Also includes -touchdowns after obtaining a lateral on a play that started with a -rushing attempt

  • -
  • rushing_fumblesNumber of rushes with a fumble

  • -
  • rushing_fumbles_lostNumber of rushes with a lost fumble

  • -
  • rushing_first_downsNumber of rushing first downs

  • -
  • rushing_epa -Expected points added (EPA) on rush attempts including scrambles and -kneel downs

  • -
  • rushing_2pt_conversionsTwo-point conversion rushes

  • -
  • completionsTotal pass completions (CMP)

  • -
  • attemptsTotal pass attempts (ATT)

  • -
  • cmp_pctPass completion percentage

  • -
  • passing_yardsTotal passing yards

  • -
  • passing_tdsTotal passing touchdowns

  • -
  • interceptionsTotal pass interceptions (INT)

  • -
  • sacksTotal number of sacks taken

  • -
  • sack_yardsTotal yards taken from sacks

  • -
  • sack_fumblesTotal fumbles from sacks

  • -
  • sack_fumbles_lostTotal fumbles lost from sacks

  • -
  • passing_air_yards -Passing air yards (includes incomplete passes)

  • -
  • passing_yards_after_catch -Yards after the catch gained on plays in which player was the passer -(this is an unofficial stat and may differ slightly between different -sources).

  • -
  • passing_first_downsFirst downs on pass attempts

  • -
  • passing_epa -Total expected points added (EPA) on pass attempts and sacks. -NOTE: This uses the variable qb_epa, which gives QB credit for EPA for -up to the point where a receiver lost a fumble after a completed catch -and makes EPA work more like passing yards on plays with fumbles

  • -
  • passing_2pt_conversionsTwo-point conversion passes

  • -
  • pacr -Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards

  • -
  • dakota -Adjusted EPA + CPOE composite based on coefficients which best predicts -adjusted EPA/play in the following year

  • -
+

diff --git a/docs/reference/get_wr_pfr_advstats_season.html b/docs/reference/get_wr_pfr_advstats_season.html index 2f47142..25425c6 100644 --- a/docs/reference/get_wr_pfr_advstats_season.html +++ b/docs/reference/get_wr_pfr_advstats_season.html @@ -43,6 +43,77 @@

Usage
get_wr_pfr_advstats_season(seasons = NULL)
+
+

Format

+

A data frame with 22 variables that are described below.

player_display_name
+

Player name (e.g., Malik Nabers)

+ +
age
+

Player age

+ +
position
+

Player position

+ +
g
+

Number of games played

+ +
gs
+

Number of games started

+ +
tgt
+

Total targets

+ +
rec
+

Total receptions

+ +
yds
+

Total receiving yards

+ +
td
+

Total receiving touchdowns

+ +
x1d
+

First downs receiving

+ +
ybc
+

Total yards passes traveled in the air before being caught or yards +before catch (YBC)

+ +
ybc_r
+

Yards before catch per reception

+ +
yac
+

Yards after catch (YAC)

+ +
yac_r
+

Yards after catch (YAC) per reception

+ +
adot
+

Average depth of target (ADOT) when targeted, whether completed or not.

+ +
brk_tkl
+

Number of broken tackles

+ +
rec_br
+

Receptions per broken tackle

+ +
drop
+

Number of dropped passes

+ +
drop_percent
+

Dropped pass percentage when targeted

+ +
int_tgt
+

Interceptions on passes where targeted

+ +
rat
+

Passer rating on passes when targeted

+ +
pfr_player_id
+

Pro Football Reference player ID (e.g., NabeMa00)

+ + +

Arguments

@@ -75,33 +146,7 @@

See also

Author

Nolan MacDonald

-
  • player_display_namePlayer name (e.g., Malik Nabers)

  • -
  • agePlayer age

  • -
  • positionPlayer position

  • -
  • gNumber of games played

  • -
  • gsNumber of games started

  • -
  • tgtTotal targets

  • -
  • recTotal receptions

  • -
  • ydsTotal receiving yards

  • -
  • tdTotal receiving touchdowns

  • -
  • x1dFirst downs receiving

  • -
  • ybc -Total yards passes traveled in the air before being caught or yards -before catch (YBC)

  • -
  • ybc_rYards before catch per reception

  • -
  • yacYards after catch (YAC)

  • -
  • yac_rYards after catch (YAC) per reception

  • -
  • adot -Average depth of target (ADOT) when targeted, whether completed or not.

  • -
  • brk_tklNumber of broken tackles

  • -
  • rec_brReceptions per broken tackle

  • -
  • dropNumber of dropped passes

  • -
  • drop_percentDropped pass percentage when targeted

  • -
  • int_tgtInterceptions on passes where targeted

  • -
  • ratPasser rating on passes when targeted

  • -
  • pfr_player_id -Pro Football Reference player ID (e.g., NabeMa00)

  • -

+ diff --git a/docs/reference/index.html b/docs/reference/index.html index 597cadb..796eb39 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -37,7 +37,7 @@

Functions -

Useful Functions

+

Play-by-Play Stats

@@ -76,7 +76,18 @@

Useful Functions
TE Stats from NFL Play-by-Play Data
-
+
+ +

Calculate Fantasy Points

+ + + +
+ + + + +
calc_fpts() @@ -94,7 +105,18 @@

Useful Functions
Calculate Fantasy Points Per Game for Common Scoring Formats
-

+
+ +

NFL Next Gen Stats (NGS)

+ + + +
+ + + + +
get_qb_ngs_advstats_season() @@ -118,7 +140,18 @@

Useful Functions
TE Cumulative Season NFL Next Gen Stats (NGS)
-

+
+ +

Pro Football Reference (PFR) Stats

+ + + +
+ + + + +
get_qb_pfr_advstats_season() @@ -142,8 +175,54 @@

Useful Functions
TE Advanced Season Stats from Pro Football Reference (PFR)
+

+ +

Combined Stats from All Sources

+ + + +
+ + + + +
+ + get_qb_combined_stats_season() + +
+
QB Cumulative Season Advanced Stats
+
+ + get_rb_combined_stats_season() + +
+
RB Cumulative Season Advanced Stats
+ get_wr_combined_stats_season() + +
+
WR Cumulative Season Advanced Stats
+
+ + get_te_combined_stats_season() + +
+
TE Cumulative Season Advanced Stats
+
+ +

Additional Utilities

+ + + +
+ + + + +
+ get_player_data()
diff --git a/docs/reference/replace_player_names.html b/docs/reference/replace_player_names.html index 8097e41..d07b3f1 100644 --- a/docs/reference/replace_player_names.html +++ b/docs/reference/replace_player_names.html @@ -37,7 +37,7 @@

Usage

-
replace_player_names(df)
+
replace_player_names(df, player_col = "player")
diff --git a/docs/search.json b/docs/search.json index 4d6f22f..90636e5 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"install-packages","dir":"Articles","previous_headings":"","what":"Install Packages","title":"Setup a Play-by-Play Database with nflfastR","text":"Data nflfastR can stored database access locally instead pulling play--play information time. database takes significant amount memory, stores data dating back 1999 season. Working database beneficial allows bring memory data actually need. Using R, relatively easy work databases long comfortable dplyr functions manipulate tidy data. use database, DBI RSQLite packages installed. install required packages, use following commands R console:","code":"install.packages(\"DBI\") install.packages(\"RSQLite\")"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"play-by-play-database","dir":"Articles","previous_headings":"","what":"Play-By-Play Database","title":"Setup a Play-by-Play Database with nflfastR","text":"Now packages installed, database can built. nflfastR uses function update_db() work databases. Using update_db() arguments build database default arguments, SQLite database stored pbp_db contains play--play data table called nflfastR_pbp. store database specified directory, use argument dbdir. specify file name use dbname change table name use tblname. already existing database want rebuild scratch, use argument force_rebuild=TRUE. typically performed update play--play data fixing bug want wipe database update . want rebuild specific seasons, can use command force_rebuild=2023 multiple seasons, force_rebuild=c(2022, 2023). Summary Database Arguments: update_db(dbdir = \"path//save/db\"): Build play--play database save path update_db(dbname=\"db_name\"): Build play--play database custom name (Default: nflfastR_pbp) update_db(tblname=\"tblname\"): Build play--play database custom table name (Default: nflfastR_pbp) update_db(force_rebuild=TRUE): Rebuild entire play--play database update_db(force_rebuild=c(2022, 2023)): Rebuild play--play database 2022-2023 seasons","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"create-database","dir":"Articles","previous_headings":"","what":"Create Database","title":"Setup a Play-by-Play Database with nflfastR","text":"first create dump database need load libraries recently installed. loading libraries, update_db() utilized create update database. example, database saved repository’s directory, data/pbp_db.","code":"# Import packages library(DBI) library(RSQLite) # Create or update the database nflfastR::update_db(dbdir = \"./data\")"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"load-database","dir":"Articles","previous_headings":"","what":"Load Database","title":"Setup a Play-by-Play Database with nflfastR","text":"database pbp_db loaded directory data/pbp_db. connected database dbConnect(), tables stored database obtained dbListTables. one table newly constructed database, nflfastR_pbp, previously discussed since default naming schemes used. Another option look fields (columns) stored table. Use dbListFields() show data available table. example , fields saved list head() used show first 10 fields since large amount data (372 fields!). Finally, play--play table loaded database dplyr::tbl(). Use play--play information write code conduct analysis, make sure disconnect database finished.","code":"# Connect to database connect <- DBI::dbConnect(RSQLite::SQLite(), \"./data/pbp_db\") # List tables tables <- DBI::dbListTables(connect) # Close the database when finished DBI::dbDisconnect(connect) tables # Connect to database connect <- DBI::dbConnect(RSQLite::SQLite(), \"./data/pbp_db\") # List fields fields <- DBI::dbListFields(connect, \"nflfastR_pbp\") # Close the database when finished DBI::dbDisconnect(connect) head(fields, 10) # Connect to database connect <- DBI::dbConnect(RSQLite::SQLite(), \"./data/pbp_db\") # Load pbp_db pbp_db <- dplyr::tbl(connect, \"nflfastR_pbp\") # Additional code here... # Close the database when finished DBI::dbDisconnect(connect)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"calling-functions-with-database","dir":"Articles","previous_headings":"","what":"Calling Functions with Database","title":"Setup a Play-by-Play Database with nflfastR","text":"Now database created saved, nuclearff functions can utilized. example, try obtaining advanced RB stats season using function get_rb_adv_stats_season(). default arguments look play--play database stored data/pbp_db named pbp_db table called nflfastR_pbp. user database saved elsewhere different names, define argument string. loading required packages, function can called.","code":"library(DBI) library(RSQLite) library(dplyr) library(nflfastR) library(stringr) library(nuclearff) rb_adv_stats <- get_rb_adv_stats_season(pbp_db = \"./data/pbp_db\", pbp_db_tbl = \"nflfastR_pbp\", season = 2024)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"additional-information","dir":"Articles","previous_headings":"","what":"Additional Information","title":"Setup a Play-by-Play Database with nflfastR","text":"determine data nflverse updated, check nflverse Data Update Availability Schedule. information, refer nflfastR package [1] nflfastR documentation.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nolan MacDonald. Author, maintainer.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"MacDonald N (2024). nuclearff: NFL Utilities Core Library Evaluating Analytics R Fantasy Football (NUCLEARFF). R package version 0.0.0, https://nuclearanalyticslab.github.io/nuclearff/, https://github.com/NuclearAnalyticsLab/nuclearff.","code":"@Manual{, title = {nuclearff: NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)}, author = {Nolan MacDonald}, year = {2024}, note = {R package version 0.0.0, https://nuclearanalyticslab.github.io/nuclearff/}, url = {https://github.com/NuclearAnalyticsLab/nuclearff}, }"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/index.html","id":"nuclearff-","dir":"","previous_headings":"","what":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","title":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","text":"NFL Utilities Core Library Evaluating Analytics R Fantasy Football (NUCLEARFF) nuclearff used obtain NFL analytics statistics using nflverse packages conjunction fantasy football. Functions created parse play--play data output dataframe contains information user needs. addition, additional capabilities added fantasy football considerations. information nflverse NFL packages available nflverse documentation. information nuclearff use package, refer documentation.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","text":"Installing nuclearff package can accomplished using remotes package. First, install remotes using following command R console: Installation nuclearff package can now performed install_github() function. reason package needs uninstalled, use command:","code":"install.packages(\"remotes\") remotes::install_github(\"NuclearAnalyticsLab/nuclearff\") remotes::install_github(\"NuclearAnalyticsLab/nuclearff\") remove.packages(\"nuclearff\")"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/index.html","id":"data-usage","dir":"","previous_headings":"","what":"Data Usage","title":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","text":"use package, play--play data nflverse packages required. default nuclearff functions assume database play--play data. Instead, play--play data pulled using nflreadr::load_pbp. alternative use database, since simple build database keep --date. Play--play data since 1999 takes lot memory, working database allows store necessary memory. Functions allow using database arguments pbp_db pbp_db_tbl. arguments must defined strings, pbp_db path database well name. pbp_db_tbl name table database. example, can store database directory data/ default naming scheme used nflfastR. means pbp_db=\"data/pbp_db\" pbp_db_tbl=\"nflfastR_pbp\". database included repository, users must download play--play database prior utilizing functions database options nuclearff. detailed instructions setting database nflfastR, view vignette using vignette(\"setup_pbp_db\") R console. Users may also refer article, Setting nflfastR Database.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Fantasy Points — calc_fpts","title":"Calculate Fantasy Points — calc_fpts","text":"Calculate Fantasy Points","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Fantasy Points — calc_fpts","text":"","code":"calc_fpts(pbp = pbp, pass_td_pts = 6, pass_int_pts = -2, rec_pts = 1)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Fantasy Points — calc_fpts","text":"pbp Play--play Dataframe pass_td_pts Passing Touchdown Points pass_int_pts Passing Interception Points rec_pts Reception Points","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Fantasy Points — calc_fpts","text":"Calculate fantasy points using play--play data user-defined scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate Fantasy Points — calc_fpts","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"Calculate Fantasy Points Common Scoring Formats","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"","code":"calc_fpts_common_formats(pbp = pbp)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"pbp Play--play Dataframe","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"Calculate fantasy points using play--play data common scoring settings (.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"Calculate Fantasy Points Per Game Common Scoring Formats","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"","code":"calc_fpts_ppg_common_formats(pbp = pbp)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"pbp Play--play Dataframe","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"Calculate fantasy points per game using play--play data common scoring settings (.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"Obtain play--play data specified time frame either saved database defined, using nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"","code":"get_pbp_data( pbp_db = NULL, pbp_db_tbl = NULL, season = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"pbp_db_tbl Play--Play database table name (optional) season NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"Dataframe NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"function get_pbp_data can utilized obtain play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information, nflfastR provides example using database Example 8: Using built-database function (https://www.nflfastr.com/articles/nflfastR.html #example-8-using--built--database-function)","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"Nolan MacDonald connect Connect play--play database RSQLite package pbp_dbLoad play--play data database table pbpPlay--play dataframe filtered season(s) week(s)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Player Identification Data — get_player_data","title":"Player Identification Data — get_player_data","text":"Obtain player identification data various platforms.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Player Identification Data — get_player_data","text":"","code":"get_player_data(season = NULL, pos = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Player Identification Data — get_player_data","text":"season NFL season year (int) pos Player position (str) \"WR\"","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Player Identification Data — get_player_data","text":"Dataframe lists player data specified season position","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Player Identification Data — get_player_data","text":"Use function get_player_data obtain player information defined season position. Player information includes several IDs platforms ESPN, Rotowire, ESPN, etc.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"Obtain QB cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"","code":"get_qb_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"Dataframe QB Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"get_qb_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. quarterbacks, stat_type defined passing updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0034796) player_display_namePlayer name (e.g., Lamar Jackson) player_namePlayer shortened name (e.g., L.Jackson) positionPlayer position pass_yardsTotal pass yards pass_touchdownsTotal pass touchdowns interceptionsTotal interceptions passer_ratingAverage passer rating attemptsTotal pass attempts completionsTotal pass completions completion_percentageAverage completion percentage (%) expected_completion_percentage completion_percentage_above_expectation Average expected completion percentage (xCOMP) avg_air_distanceAverage air distance max_air_distanceMaximum longest air distance avg_time_to_throwAverage time throw (TT) avg_completed_air_yardsAverage completed air yards (CAY) avg_intended_air_yardsAverage intended air yards (IAY) avg_air_yards_differential Average air yards differential (AYD) aggressivenessAverage aggressiveness (AGG%) max_completed_air_distance Maximum longest completed air distance (LCAD) avg_air_yards_to_sticks Average air yards sticks (AYTS)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"Obtain QB stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"","code":"get_qb_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, season = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) season NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"Dataframe QB stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"function get_qb_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0034796) player_display_namePlayer name (e.g., Lamar Jackson) player_namePlayer shortened name (e.g., L.Jackson) positionPlayer position (e.g., QB) teamPlayer team (e.g., BAL) gamesNumber games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD completionsTotal pass completions (CMP) attemptsTotal pass attempts (ATT) cmp_pctPass completion percentage passing_yardsTotal passing yards passing_tdsTotal passing touchdowns interceptionsTotal pass interceptions (INT) sacksTotal number sacks taken sack_yardsTotal yards taken sacks sack_fumblesTotal fumbles sacks sack_fumbles_lostTotal fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downsFirst downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversionsTwo-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumblesNumber rushes fumble rushing_fumbles_lostNumber rushes lost fumble rushing_first_downsNumber rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversionsTwo-point conversion rushes targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumblesNumber fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_2pt_conversionsTwo-point conversion receptions","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"Obtain QB advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"","code":"get_qb_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"Dataframe QB advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"get_qb_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. quarterbacks, stat_type defined pass. information available QB PFR advanced stats PFR passing data dictionary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"Nolan MacDonald player_display_namePlayer name (e.g., Lamar Jackson) pass_attemptsTotal pass attempts throwawaysNumber throwaways spikesNumber spikes dropsNumber throws dropped drop_pctPercentage dropped throws bad_throwsNumber bad throws bad_throw_pctPercentage bad throws pocket_timeAverage time pocket times_blitzedNumber times blitzed times_hurriedNumber times hurried times_hitNumber times hit times_pressuredNumber times pressured pressure_pctPercent time pressured batted_ballsNumber batted balls on_tgt_throwsNumber throws target on_tgt_pctPercent throws target rpo_playsRun-pass-option (RPO) number plays rpo_yardsRun-pass-option (RPO) total yards rpo_pass_attRun-pass-option (RPO) pass attempts rpo_pass_yardsRun-pass-option (RPO) pass yards rpo_rush_attRun-pass-option (RPO) rush attempts rpo_rush_yardsRun-pass-option (RPO) rush yards pa_pass_attPlay action pass attempts pa_pass_yardsPlay action pass yards pfr_player_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"Obtain RB cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"","code":"get_rb_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"Dataframe RB Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"get_rb_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. running backs, stat_type defined rushing updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0038120) player_display_namePlayer name (e.g., Breece Hall) player_namePlayer shortened name (e.g., B.Hall) positionPlayer position rush_attemptsTotal rush attempts rush_yardsTotal rush yards avg_rush_yardsAverage rush yards per attempt rush_touchdownsTotal rush touchdowns efficiencyAverage efficiency (EFF) percent_attempts_gte_eight_defenders Average % attempts 8+ Defenders Box (8+D%) avg_time_to_losAverage time behind line scrimmage (TLOS) expected_rush_yardsAverage expected rush yards rush_yards_over_expectedAverage rush yards expected rush_yards_over_expected_per_att Average rush yards expected per attempt rush_pct_over_expectedAverage rush % expected","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"Obtain RB stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"","code":"get_rb_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, season = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) season NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"Dataframe RB stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"function get_rb_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0038120) player_display_namePlayer name (e.g., Breece Hall) player_namePlayer shortened name (e.g., B.Hall) positionPlayer position (e.g., RB) teamPlayer team (e.g., NYJ) gamesNumber games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumblesNumber rushes fumble rushing_fumbles_lostNumber rushes lost fumble rushing_first_downsNumber rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversionsTwo-point conversion rushes targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumblesNumber fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_epaExpected points added receptions receiving_2pt_conversionsTwo-point conversion receptions racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards target_share Share targets player compared team targets tgt_pctShare targets percentage air_yards_share Share receiving_air_yards player team air_yards wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share completionsTotal pass completions (CMP) attemptsTotal pass attempts (ATT) cmp_pctPass completion percentage passing_yardsTotal passing yards passing_tdsTotal passing touchdowns interceptionsTotal pass interceptions (INT) sacksTotal number sacks taken sack_yardsTotal yards taken sacks sack_fumblesTotal fumbles sacks sack_fumbles_lostTotal fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downsFirst downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversionsTwo-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"Obtain RB advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"","code":"get_rb_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"Dataframe RB advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"get_rb_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. running backs, stat_type defined rush. information available RB PFR advanced stats seasons PFR site PFR 2024 NFL Advanced Rushing.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"Nolan MacDonald player_display_namePlayer name (e.g., Lamar Jackson) age position gNumber games played gsNumber games started attTotal rush attempts ydsTotal rush yards tdTotal rush touchdowns x1dRushing first downs ybcRushing yards contact ybc_attRushing yards contact per rushing attempt yacRushing yards contact yac_attRushing yards contact per attempt brk_tklBroken tackles rushes att_brRush attempts per broken tackle pfr_player_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":null,"dir":"Reference","previous_headings":"","what":"Player Snap Share — get_snap_share","title":"Player Snap Share — get_snap_share","text":"Obtain player snap shares provided Pro Football Reference (PFR), starting 2012 season.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Player Snap Share — get_snap_share","text":"","code":"get_snap_share(season = NULL, pos = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Player Snap Share — get_snap_share","text":"pos Player position (str) seasons NFL Season(s) (int) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Player Snap Share — get_snap_share","text":"Obtain player snap share percentage positional group","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Player Snap Share — get_snap_share","text":"function loads game level snap counts PFR starting 2012 season. Snap count data utilized filter season player position. Additional data wrangling performed format player names order merge easily play--play data. information available snap counts Load Snap Counts PFR.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Player Snap Share — get_snap_share","text":"Nolan MacDonald playerPlayer name (e.g., Darnell Mooney) positionPlayer name (e.g., WR) teamPlayer team pfr_player_idPro Football Reference (PFR) player ID snapsNumber snaps snap_shareFraction total snaps snap_pctPercentage total snaps","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"Obtain WR cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"","code":"get_te_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"Dataframe TE Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"get_te_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. receivers, stat_type defined receiving updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0037744) player_display_namePlayer name (e.g., Trey McBride) player_namePlayer shortened name (e.g., T.McBride) positionPlayer position targetsTotal receiving targets receptionsTotal receptions yardsTotal receiving yards rec_touchdownsTotal reception touchdowns avg_cushionAverage cushion (CUSH) avg_separationAverage separation (SEP) avg_intended_air_yardsAverage targeted air yards (TAY) avg_percent_share_of_intended_air_yards Average % share team's air yards (TAY%) avg_catch_percentageAverage catch percentage avg_yacAverage yards catch (YAC) avg_expected_yacAverage expected yards catch (xYAC) avg_yac_above_expectation Average yards catch expectation (+/-)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"Obtain TE stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"","code":"get_te_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, season = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) season NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"Dataframe TE stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"function get_te_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0038120) player_display_namePlayer name (e.g., Breece Hall) player_namePlayer shortened name (e.g., B.Hall) positionPlayer position (e.g., RB) teamPlayer team (e.g., NYJ) gamesNumber games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumblesNumber fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_epaExpected points added receptions receiving_2pt_conversionsTwo-point conversion receptions racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards target_share Share targets player compared team targets tgt_pctShare targets percentage air_yards_share Share receiving_air_yards player team air_yards wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumblesNumber rushes fumble rushing_fumbles_lostNumber rushes lost fumble rushing_first_downsNumber rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversionsTwo-point conversion rushes completionsTotal pass completions (CMP) attemptsTotal pass attempts (ATT) cmp_pctPass completion percentage passing_yardsTotal passing yards passing_tdsTotal passing touchdowns interceptionsTotal pass interceptions (INT) sacksTotal number sacks taken sack_yardsTotal yards taken sacks sack_fumblesTotal fumbles sacks sack_fumbles_lostTotal fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downsFirst downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversionsTwo-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"Obtain TE advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"","code":"get_te_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"Dataframe TE advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"get_te_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. receivers, stat_type defined rec. information available TE PFR advanced stats seasons PFR site PFR 2024 NFL Advanced Receiving.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"Nolan MacDonald player_display_namePlayer name (e.g., George Kittle) agePlayer age positionPlayer position gNumber games played gsNumber games started tgtTotal targets recTotal receptions ydsTotal receiving yards tdTotal receiving touchdowns x1dFirst downs receiving ybc Total yards passes traveled air caught yards catch (YBC) ybc_rYards catch per reception yacYards catch (YAC) yac_rYards catch (YAC) per reception adot Average depth target (ADOT) targeted, whether completed . brk_tklNumber broken tackles rec_brReceptions per broken tackle dropNumber dropped passes drop_percentDropped pass percentage targeted int_tgtInterceptions passes targeted ratPasser rating passes targeted pfr_player_id Pro Football Reference player ID (e.g., KittGe00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"Obtain WR cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"","code":"get_wr_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"Dataframe WR Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"get_wr_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. receivers, stat_type defined receiving updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0039337) player_display_namePlayer name (e.g., Malik Nabers) player_namePlayer shortened name (e.g., M.Nabers) positionPlayer position targetsTotal receiving targets receptionsTotal receptions yardsTotal receiving yards rec_touchdownsTotal reception touchdowns avg_cushionAverage cushion (CUSH) avg_separationAverage separation (SEP) avg_intended_air_yardsAverage targeted air yards (TAY) avg_percent_share_of_intended_air_yards Average % share team's air yards (TAY%) avg_catch_percentageAverage catch percentage avg_yacAverage yards catch (YAC) avg_expected_yacAverage expected yards catch (xYAC) avg_yac_above_expectation Average yards catch expectation (+/-)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"Obtain WR stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"","code":"get_wr_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, season = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) season NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"Dataframe WR stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"function get_wr_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"Nolan MacDonald player_idPlayer gsis id (e.g., 00-0038120) player_display_namePlayer name (e.g., Breece Hall) player_namePlayer shortened name (e.g., B.Hall) positionPlayer position (e.g., RB) teamPlayer team (e.g., NYJ) gamesNumber games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumblesNumber fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_epaExpected points added receptions receiving_2pt_conversionsTwo-point conversion receptions racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards target_share Share targets player compared team targets tgt_pctShare targets percentage air_yards_share Share receiving_air_yards player team air_yards wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumblesNumber rushes fumble rushing_fumbles_lostNumber rushes lost fumble rushing_first_downsNumber rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversionsTwo-point conversion rushes completionsTotal pass completions (CMP) attemptsTotal pass attempts (ATT) cmp_pctPass completion percentage passing_yardsTotal passing yards passing_tdsTotal passing touchdowns interceptionsTotal pass interceptions (INT) sacksTotal number sacks taken sack_yardsTotal yards taken sacks sack_fumblesTotal fumbles sacks sack_fumbles_lostTotal fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downsFirst downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversionsTwo-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"Obtain WR advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"","code":"get_wr_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"Dataframe WR advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"get_wr_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. receivers, stat_type defined rec. information available WR PFR advanced stats seasons PFR site PFR 2024 NFL Advanced Receiving.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"Nolan MacDonald player_display_namePlayer name (e.g., Malik Nabers) agePlayer age positionPlayer position gNumber games played gsNumber games started tgtTotal targets recTotal receptions ydsTotal receiving yards tdTotal receiving touchdowns x1dFirst downs receiving ybc Total yards passes traveled air caught yards catch (YBC) ybc_rYards catch per reception yacYards catch (YAC) yac_rYards catch (YAC) per reception adot Average depth target (ADOT) targeted, whether completed . brk_tklNumber broken tackles rec_brReceptions per broken tackle dropNumber dropped passes drop_percentDropped pass percentage targeted int_tgtInterceptions passes targeted ratPasser rating passes targeted pfr_player_id Pro Football Reference player ID (e.g., NabeMa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Load Play-by-Play Data from Database — load_data_from_db","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Helper function load play--play data nflreadr specified time frame.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"","code":"load_data_from_db(pbp_db, pbp_db_tbl, season, week_min, week_max)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"pbp_db_tbl Play--Play database table name season NFL season obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Dataframe containing filtered play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Helper function load play--play data database. function filters data include specified time frame including seasons range weeks. week_max provided, filter week_min week_max week_max provided, filter weeks >= week_min get remainder season. function typically utilized user desires loading play--play data database defined pbp_db pbp_db_tbl strings.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Helper function load play--play data nflreadr specified time frame.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"","code":"load_data_from_nflreadr(season, week_min, week_max)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"season NFL season obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week define range weeks pull NFL season. defined, data pulled weeks, beginning week_min.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Dataframe containing filtered play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Helper function load play--play data nflreadr. function filters data include specified time frame including seasons range weeks. week_max provided, filter week_min week_max week_max provided, filter weeks >= week_min get remainder season. function typically utilized user loading play--play data database.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Cleanup Player Names — replace_player_names","title":"Helper - Cleanup Player Names — replace_player_names","text":"String parsing helper cleanup player names continuity.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Cleanup Player Names — replace_player_names","text":"","code":"replace_player_names(df)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Cleanup Player Names — replace_player_names","text":"df Dataframe player column clean names","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Cleanup Player Names — replace_player_names","text":"Dataframe cleaned player names","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Cleanup Player Names — replace_player_names","text":"function replace_player_names reads dataframe includes player names uses str_replace clean names. can used across package joining data player names . function strips names suffixes like Jr., Sr., II, III. Also, first names abbreviations like D.J. Moore D.K. Metcalf periods stripped initials. player names specified say . specific cases defined explicitly.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Cleanup Player Names — replace_player_names","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Cleanup Team Abbreviations — replace_team_names","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"String parsing helper cleanup team abbreviations continuity.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"","code":"replace_team_names(df)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"df Dataframe team column clean abbreviations","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"Dataframe cleaned team abbreviations","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"function team_player_names reads dataframe includes team names team uses str_replace replace team abbreviation. can used across package joining data team names . Team specific cases defined explicitly, alleviate issue data differences. example, nflreadr roster data lists Los Angeles Rams LA, nflfastR play--play data lists abbreviation LAR.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"Validation helper determine seasons argument obtain NGS 2016 later.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"","code":"validate_ngs_season(season)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"season NFL season obtain NGS data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"Validate season defined integer 2016 greater","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"function validate_ngs_season can utilized validate whether arguments season appropriate NFL NGS dates back 2016. season defined prior 2016, error occur.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"Validation helper determine path play--play database, pbp_db, database table name, pbp_db_tbl, defined strings.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"","code":"validate_pbp_db(pbp_db, pbp_db_tbl)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"pbp_db_tbl Play--Play database table name (str) pbp_dp Play--Play database path (str)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"Validate pbp_db pbp_db_tbl strings","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"function validate_pbp_db can utilized validate whether arguments load database get_pbp_data valid defined strings.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"Validation helper determine seasons argument obtain play--play database 1999 later.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"","code":"validate_pbp_season(season)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"season NFL season obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"Validate season defined integer 1999 greater","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"function validate_pbp_season can utilized validate whether arguments season appropriate NFL play--play data dates back 1999. season defined prior 1999, error occur.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"Validation helper determine weeks defined properly filter play--play data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"","code":"validate_pbp_weeks(week_min, week_max)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"week_min Minimum week define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week define range weeks pull NFL season. defined, data pulled weeks, beginning week_min.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"Validate weeks defined integers","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"function validate_pbp_weeks utilized determine weeks defined integers week_min week_max.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"Validation helper determine seasons argument obtain PFR 2018 later.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"","code":"validate_pfr_season(season)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"season NFL season obtain NGS data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"Validate season defined integer 2018 greater","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"function validate_pfr_season can utilized validate whether arguments season appropriate PFR advanced stats dates back 2018. season defined prior 2018, error occur.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"Nolan MacDonald","code":""}] +[{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"install-packages","dir":"Articles","previous_headings":"","what":"Install Packages","title":"Setup a Play-by-Play Database with nflfastR","text":"Data nflfastR can stored database access locally instead pulling play--play information time. database takes significant amount memory, stores data dating back 1999 season. Working database beneficial allows bring memory data actually need. Using R, relatively easy work databases long comfortable dplyr functions manipulate tidy data. use database, DBI RSQLite packages installed. install required packages, use following commands R console:","code":"install.packages(\"DBI\") install.packages(\"RSQLite\")"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"play-by-play-database","dir":"Articles","previous_headings":"","what":"Play-By-Play Database","title":"Setup a Play-by-Play Database with nflfastR","text":"Now packages installed, database can built. nflfastR uses function update_db() work databases. Using update_db() arguments build database default arguments, SQLite database stored pbp_db contains play--play data table called nflfastR_pbp. store database specified directory, use argument dbdir. specify file name use dbname change table name use tblname. already existing database want rebuild scratch, use argument force_rebuild=TRUE. typically performed update play--play data fixing bug want wipe database update . want rebuild specific seasons, can use command force_rebuild=2023 multiple seasons, force_rebuild=c(2022, 2023). Summary Database Arguments: update_db(dbdir = \"path//save/db\"): Build play--play database save path update_db(dbname=\"db_name\"): Build play--play database custom name (Default: nflfastR_pbp) update_db(tblname=\"tblname\"): Build play--play database custom table name (Default: nflfastR_pbp) update_db(force_rebuild=TRUE): Rebuild entire play--play database update_db(force_rebuild=c(2022, 2023)): Rebuild play--play database 2022-2023 seasons","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"create-database","dir":"Articles","previous_headings":"","what":"Create Database","title":"Setup a Play-by-Play Database with nflfastR","text":"first create dump database need load libraries recently installed. loading libraries, update_db() utilized create update database. example, database saved repository’s directory, data/pbp_db.","code":"# Import packages library(DBI) library(RSQLite) # Create or update the database nflfastR::update_db(dbdir = \"./data\")"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"load-database","dir":"Articles","previous_headings":"","what":"Load Database","title":"Setup a Play-by-Play Database with nflfastR","text":"database pbp_db loaded directory data/pbp_db. connected database dbConnect(), tables stored database obtained dbListTables. one table newly constructed database, nflfastR_pbp, previously discussed since default naming schemes used. Another option look fields (columns) stored table. Use dbListFields() show data available table. example , fields saved list head() used show first 10 fields since large amount data (372 fields!). Finally, play--play table loaded database dplyr::tbl(). Use play--play information write code conduct analysis, make sure disconnect database finished.","code":"# Connect to database connect <- DBI::dbConnect(RSQLite::SQLite(), \"./data/pbp_db\") # List tables tables <- DBI::dbListTables(connect) # Close the database when finished DBI::dbDisconnect(connect) tables # Connect to database connect <- DBI::dbConnect(RSQLite::SQLite(), \"./data/pbp_db\") # List fields fields <- DBI::dbListFields(connect, \"nflfastR_pbp\") # Close the database when finished DBI::dbDisconnect(connect) head(fields, 10) # Connect to database connect <- DBI::dbConnect(RSQLite::SQLite(), \"./data/pbp_db\") # Load pbp_db pbp_db <- dplyr::tbl(connect, \"nflfastR_pbp\") # Additional code here... # Close the database when finished DBI::dbDisconnect(connect)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"calling-functions-with-database","dir":"Articles","previous_headings":"","what":"Calling Functions with Database","title":"Setup a Play-by-Play Database with nflfastR","text":"Now database created saved, nuclearff functions can utilized. example, try obtaining advanced RB stats season using function get_rb_adv_stats_season(). default arguments look play--play database stored data/pbp_db named pbp_db table called nflfastR_pbp. user database saved elsewhere different names, define argument string. loading required packages, function can called.","code":"library(DBI) library(RSQLite) library(dplyr) library(nflfastR) library(stringr) library(nuclearff) rb_adv_stats <- get_rb_adv_stats_season(pbp_db = \"./data/pbp_db\", pbp_db_tbl = \"nflfastR_pbp\", season = 2024)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/articles/setup_pbp_db.html","id":"additional-information","dir":"Articles","previous_headings":"","what":"Additional Information","title":"Setup a Play-by-Play Database with nflfastR","text":"determine data nflverse updated, check nflverse Data Update Availability Schedule. information, refer nflfastR package [1] nflfastR documentation.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nolan MacDonald. Author, maintainer.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"MacDonald N (2024). nuclearff: NFL Utilities Core Library Evaluating Analytics R Fantasy Football (NUCLEARFF). R package version 0.0.0, https://nuclearanalyticslab.github.io/nuclearff/, https://github.com/NuclearAnalyticsLab/nuclearff.","code":"@Manual{, title = {nuclearff: NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)}, author = {Nolan MacDonald}, year = {2024}, note = {R package version 0.0.0, https://nuclearanalyticslab.github.io/nuclearff/}, url = {https://github.com/NuclearAnalyticsLab/nuclearff}, }"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/index.html","id":"nuclearff-","dir":"","previous_headings":"","what":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","title":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","text":"NFL Utilities Core Library Evaluating Analytics R Fantasy Football (NUCLEARFF) nuclearff used obtain NFL analytics statistics using nflverse packages conjunction fantasy football. Functions created parse play--play data output dataframe contains information user needs. addition, additional capabilities added fantasy football considerations. information nflverse NFL packages available nflverse documentation. information nuclearff use package, refer documentation.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","text":"Installing nuclearff package can accomplished using remotes package. First, install remotes using following command R console: Installation nuclearff package can now performed install_github() function. reason package needs uninstalled, use command:","code":"install.packages(\"remotes\") remotes::install_github(\"NuclearAnalyticsLab/nuclearff\") remotes::install_github(\"NuclearAnalyticsLab/nuclearff\") remove.packages(\"nuclearff\")"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/index.html","id":"data-usage","dir":"","previous_headings":"","what":"Data Usage","title":"NFL Utilities Core Library for Evaluating Analytics in R with Fantasy Football (NUCLEARFF)","text":"use package, play--play data nflverse packages required. default nuclearff functions assume database play--play data. Instead, play--play data pulled using nflreadr::load_pbp. alternative use database, since simple build database keep --date. Play--play data since 1999 takes lot memory, working database allows store necessary memory. Functions allow using database arguments pbp_db pbp_db_tbl. arguments must defined strings, pbp_db path database well name. pbp_db_tbl name table database. example, can store database directory data/ default naming scheme used nflfastR. means pbp_db=\"data/pbp_db\" pbp_db_tbl=\"nflfastR_pbp\". database included repository, users must download play--play database prior utilizing functions database options nuclearff. detailed instructions setting database nflfastR, view vignette using vignette(\"setup_pbp_db\") R console. Users may also refer article, Setting nflfastR Database.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Fantasy Points — calc_fpts","title":"Calculate Fantasy Points — calc_fpts","text":"Calculate fantasy points using play--play data user-defined scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Fantasy Points — calc_fpts","text":"","code":"calc_fpts(pbp = pbp, pass_td_pts = 6, pass_int_pts = -2, rec_pts = 1)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Fantasy Points — calc_fpts","text":"pbp Play--play Dataframe pass_td_pts Passing Touchdown Points pass_int_pts Passing Interception Points rec_pts Reception Points","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Fantasy Points — calc_fpts","text":"Dataframe total fantasy points using play--play data user-defined scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate Fantasy Points — calc_fpts","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"Calculate fantasy points using play--play data common scoring settings (.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"","code":"calc_fpts_common_formats(pbp = pbp)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"data frame 79 variables described . fpts_std_4pt_td Total fantasy points standard scoring 4 point touchdowns ppg_std_4pt_td Points per game (PPG) standard scoring 4 point touchdowns fpts_half_ppr_4pt_td Total fantasy points half point per reception (Half PPR) scoring 4 point touchdowns ppg_half_ppr_4pt_td Points per game (PPG) half point per reception (Half PPR) scoring 4 point touchdowns fpts_ppr_4pt_td Total fantasy points point per reception (full PPR) scoring 4 point touchdowns ppg_ppr_4pt_td Points per game (PPG) point per reception (Full PPR) scoring 4 point touchdowns fpts_std_6pt_td Total fantasy points standard scoring 6 point touchdowns ppg_std_6pt_td Points per game (PPG) standard scoring 6 point touchdowns fpts_half_ppr_6pt_td Total fantasy points half point per reception (Half PPR) scoring 6 point touchdowns ppg_half_ppr_6pt_td Points per game (PPG) half point per reception (Half PPR) scoring 6 point touchdowns fpts_ppr_6pt_td Total fantasy points point per reception (full PPR) scoring 6 point touchdowns ppg_ppr_6pt_td Points per game (PPG) point per reception (Full PPR) scoring 6 point touchdowns","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"pbp Play--play Data frame","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"Data frame total fantasy points common scoring settings (.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_common_formats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate Fantasy Points for Common Scoring Formats — calc_fpts_common_formats","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"Calculate fantasy points per game using play--play data common scoring settings (.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"","code":"calc_fpts_ppg_common_formats(pbp = pbp)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"pbp Play--play Dataframe","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"Dataframe fantasy points per game (PPG) using common scoring settings (.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate Fantasy Points Per Game for Common Scoring Formats — calc_fpts_ppg_common_formats","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"Obtain play--play data specified time frame either saved database defined, using nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"","code":"get_pbp_data( pbp_db = NULL, pbp_db_tbl = NULL, season = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"pbp_db_tbl Play--Play database table name (optional) season NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"Dataframe NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"function get_pbp_data can utilized obtain play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information, nflfastR provides example using database Example 8: Using built-database function (https://www.nflfastr.com/articles/nflfastR.html #example-8-using--built--database-function)","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Obtain Play-by-Play Data for Specified Time Frame — get_pbp_data","text":"Nolan MacDonald connect Connect play--play database RSQLite package pbp_dbLoad play--play data database table pbpPlay--play dataframe filtered season(s) week(s)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Player Identification Data — get_player_data","title":"Player Identification Data — get_player_data","text":"Obtain player identification data various platforms.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Player Identification Data — get_player_data","text":"","code":"get_player_data(seasons = NULL, position = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Player Identification Data — get_player_data","text":"seasons NFL season year (int) position Player position (str) \"WR\"","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Player Identification Data — get_player_data","text":"Dataframe lists player data specified season position","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Player Identification Data — get_player_data","text":"Use function get_player_data obtain player information defined season position. Player information includes several IDs platforms ESPN, Rotowire, ESPN, etc.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","title":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","text":"Obtain QB stats NFL cumulative season stats specified time frame either saved database nflreadr::load_pbp(). stats obtained using play--play data, NFL Next Gen Stats (NGS) Pro Football Reference (PFR).","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","text":"","code":"get_qb_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","text":"data frame 79 variables described . player_id Player gsis id (e.g., 00-0034796) player_display_name Player name (e.g., Lamar Jackson) player_name Player shortened name (e.g., L.Jackson) pos Player position (e.g., QB) tm Player team (e.g., BAL) g Number games played completions Total pass completions (CMP)PBP data attempts Total pass attempts (ATT)PBP data cmp_pct Pass completion percentage PBP data expected_completion_percentage Expected completion percentage NGS completion_percentage_above_expectation Average expected completion percentage (xCOMP) NGS passing_yards Total passing yards PBP data passing_tds Total passing touchdowns PBP data interceptions Total pass interceptions (INT) PBP data passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passer_rating Average passer rating NGS pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards PBP data dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year PBP data aggressiveness Average aggressiveness (AGG%) NGS passing_air_yards Passing air yards (includes incomplete passes) PBP data passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources) PBP data avg_air_distance Average air distance NGS max_air_distance Maximum longest air distance NGS avg_time_to_throw Average time throw (TT) NGS avg_completed_air_yards Average completed air yards (CAY) NGS avg_intended_air_yards Average intended air yards (IAY) NGS avg_air_yards_differential Average air yards differential (AYD) NGS max_completed_air_distance Maximum longest completed air distance (LCAD) NGS avg_air_yards_to_sticks Average air yards sticks (AYTS) NGS passing_first_downs First downs pass attempts PBP data throwaways Number throwaways PFR spikes Number spikes PFR drops Number throws dropped PFR drop_pct Percentage dropped throws PFR bad_throws Number bad throws PFR bad_throw_pct Percentage bad throws PFR pocket_time Average time pocket PFR times_blitzed Number times blitzed PFR times_hurried Number times hurried PFR times_hit Number times hit PFR times_pressured Number times pressured PFR pressure_pct Percent time pressured PFR batted_balls Number batted balls PFR on_tgt_throws Number throws target PFR on_tgt_pct Percent throws target PFR rpo_plays Run-pass-option (RPO) number plays PFR rpo_yards Run-pass-option (RPO) total yards PFR rpo_pass_att Run-pass-option (RPO) pass attempts PFR rpo_pass_yards Run-pass-option (RPO) pass yards PFR rpo_rush_att Run-pass-option (RPO) rush attempts PFR rpo_rush_yards Run-pass-option (RPO) rush yards PFR pa_pass_att Play action pass attempts PFR pa_pass_yards Play action pass yards PFR passing_2pt_conversions Two-point conversion passes PBP data sacks Total number sacks taken PBP data sack_yards Total yards taken sacks PBP data sack_fumbles Total fumbles sacks PBP data sack_fumbles_lost Total fumbles lost sacks PBP data carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry PBP data rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt PBP data rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt PBP data rushing_fumbles Number rushes fumble PBP data rushing_fumbles_lost Number rushes lost fumble PBP data rushing_first_downs Number rushing first downs PBP data rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs PBP data rushing_2pt_conversions Two-point conversion rushes PBP data fpts_std_4pt_td Total fantasy points standard scoring 4 point touchdowns ppg_std_4pt_td Points per game (PPG) standard scoring 4 point touchdowns fpts_half_ppr_4pt_td Total fantasy points half point per reception (Half PPR) scoring 4 point touchdowns ppg_half_ppr_4pt_td Points per game (PPG) half point per reception (Half PPR) scoring 4 point touchdowns fpts_ppr_4pt_td Total fantasy points point per reception (full PPR) scoring 4 point touchdowns ppg_ppr_4pt_td Points per game (PPG) point per reception (Full PPR) scoring 4 point touchdowns fpts_std_6pt_td Total fantasy points standard scoring 6 point touchdowns ppg_std_6pt_td Points per game (PPG) standard scoring 6 point touchdowns fpts_half_ppr_6pt_td Total fantasy points half point per reception (Half PPR) scoring 6 point touchdowns ppg_half_ppr_6pt_td Points per game (PPG) half point per reception (Half PPR) scoring 6 point touchdowns fpts_ppr_6pt_td Total fantasy points point per reception (full PPR) scoring 6 point touchdowns ppg_ppr_6pt_td Points per game (PPG) point per reception (Full PPR) scoring 6 point touchdowns pfr_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","text":"Dataframe QB stats user-defined season(s) obtained NFL play--play data, Next Gen Stats (NGS) Pro Football Reference (PFR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","text":"function get_qb_combined_stats_season can utilized obtain player stats season, including advanced stats. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season. Play--play data merged NFL Next Gen Stats (NGS) utilizing nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. Play--play data also merged advanced stats Pro Football Reference (PFR), beginning 2018. Note use function, seasons must 2018 later.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"QB Cumulative Season Advanced Stats — get_qb_combined_stats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"Obtain QB cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"","code":"get_qb_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"data frame 33 variables described . player_id Player gsis id (e.g., 00-0034796) player_display_name Player name (e.g., Lamar Jackson) player_name Player shortened name (e.g., L.Jackson) position Player position pass_yards Total pass yards pass_touchdowns Total pass touchdowns interceptions Total interceptions passer_rating Average passer rating attempts Total pass attempts completions Total pass completions completion_percentage Average completion percentage (%) expected_completion_percentage Expected completion percentage completion_percentage_above_expectation Average expected completion percentage (xCOMP) avg_air_distance Average air distance max_air_distance Maximum longest air distance avg_time_to_throw Average time throw (TT) avg_completed_air_yards Average completed air yards (CAY) avg_intended_air_yards Average intended air yards (IAY) avg_air_yards_differential Average air yards differential (AYD) aggressiveness Average aggressiveness (AGG%) max_completed_air_distance Maximum longest completed air distance (LCAD) avg_air_yards_to_sticks Average air yards sticks (AYTS)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"Dataframe QB Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"get_qb_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. quarterbacks, stat_type defined passing updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"QB Cumulative Season NFL Next Gen Stats (NGS) — get_qb_ngs_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"Obtain QB stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"","code":"get_qb_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"data frame 57 variables described . player_id Player gsis id (e.g., 00-0034796) player_display_name Player name (e.g., Lamar Jackson) player_name Player shortened name (e.g., L.Jackson) position Player position (e.g., QB) team Player team (e.g., BAL) games Number games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD completions Total pass completions (CMP) attempts Total pass attempts (ATT) cmp_pct Pass completion percentage passing_yards Total passing yards passing_tds Total passing touchdowns interceptions Total pass interceptions (INT) sacks Total number sacks taken sack_yards Total yards taken sacks sack_fumbles Total fumbles sacks sack_fumbles_lost Total fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downs First downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversions Two-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumbles Number rushes fumble rushing_fumbles_lost Number rushes lost fumble rushing_first_downs Number rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversions Two-point conversion rushes targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumbles Number fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_2pt_conversions Two-point conversion receptions","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season(s) (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"Dataframe QB stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"function get_qb_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"QB Stats from NFL Play-by-Play Data — get_qb_pbp_stats","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"Obtain QB advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"","code":"get_qb_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"data frame 26 variables described . player_display_name Player name (e.g., Lamar Jackson) pass_attempts Total pass attempts throwaways Number throwaways spikes Number spikes drops Number throws dropped drop_pct Percentage dropped throws bad_throws Number bad throws bad_throw_pct Percentage bad throws pocket_time Average time pocket times_blitzed Number times blitzed times_hurried Number times hurried times_hit Number times hit times_pressured Number times pressured pressure_pct Percent time pressured batted_balls Number batted balls on_tgt_throws Number throws target on_tgt_pct Percent throws target rpo_plays Run-pass-option (RPO) number plays rpo_yards Run-pass-option (RPO) total yards rpo_pass_att Run-pass-option (RPO) pass attempts rpo_pass_yards Run-pass-option (RPO) pass yards rpo_rush_att Run-pass-option (RPO) rush attempts rpo_rush_yards Run-pass-option (RPO) rush yards pa_pass_att Play action pass attempts pa_pass_yards Play action pass yards pfr_player_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"Dataframe QB advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"get_qb_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. quarterbacks, stat_type defined pass. information available QB PFR advanced stats PFR passing data dictionary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"QB Advanced Season Stats from Pro Football Reference (PFR) — get_qb_pfr_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","title":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","text":"Obtain RB stats NFL cumulative season stats specified time frame either saved database nflreadr::load_pbp(). stats obtained using play--play data, NFL Next Gen Stats (NGS) Pro Football Reference (PFR).","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","text":"","code":"get_rb_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","text":"data frame 57 variables described . player_id Player gsis id (e.g., 00-0034796) player_display_name Player name (e.g., Lamar Jackson) player_name Player shortened name (e.g., L.Jackson) pos Player position (e.g., QB) tm Player team (e.g., BAL) g Number games played carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry PBP data rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt PBP data rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt PBP data rushing_fumbles Number rushes fumble PBP data rushing_fumbles_lost Number rushes lost fumble PBP data rushing_first_downs Number rushing first downs PBP data rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs PBP data rushing_2pt_conversions Two-point conversion rushes PBP data efficiency Average efficiency (EFF) NGS percent_attempts_gte_eight_defenders Average percent attempts 8+ Defenders Box (8+D) NGS avg_time_to_los Average time behind line scrimmage (TLOS) NGS avg_rush_yards Average rush yards per attempt expected_rush_yards Average expected rush yards NGS rush_yards_over_expected Average rush yards expected NGS rush_yards_over_expected_per_att Average rush yards expected per attempt NGS rush_pct_over_expected Average rush percent expected NGS ybc Rushing yards contact PFR ybc_att Rushing yards contact per rushing attempt PFR yac Rushing yards contact PFR yac_att Rushing yards contact per attempt PFR brk_tkl Broken tackles rushes PFR att_br Rush attempts per broken tackle PFR fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD tgt Number pass plays player targeted receiver PBP data rec Number pass receptions. Lateral receptions count reception PBP data rec_yds Yards gained pass reception. Includes yards gained receiving lateral play started pass play PBP data rec_td Number reception touchdowns, including receiving lateral play began pass play PBP data receiving_fumbles Number fumbles pass reception PBP data receiving_fumbles_lost Number fumbles lost pass reception PBP data receiving_air Receiving air yards including incomplete passes PBP data yac_rec Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) PBP data x1d_rec Number first downs gained reception PBP data receiving_epa Expected points added receptions PBP data pfr_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","text":"Dataframe QB stats user-defined season(s) obtained NFL play--play data, Next Gen Stats (NGS) Pro Football Reference (PFR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","text":"function get_rb_combined_stats_season can utilized obtain player stats season, including advanced stats. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season. Play--play data merged NFL Next Gen Stats (NGS) utilizing nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. Play--play data also merged advanced stats Pro Football Reference (PFR), beginning 2018. Note use function, seasons must 2018 later.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"RB Cumulative Season Advanced Stats — get_rb_combined_stats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"Obtain RB cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"","code":"get_rb_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"data frame 15 variables described . player_id Player gsis id (e.g., 00-0038120) player_display_name Player name (e.g., Breece Hall) player_name Player shortened name (e.g., B.Hall) position Player position rush_attempts Total rush attempts rush_yards Total rush yards avg_rush_yards Average rush yards per attempt rush_touchdowns Total rush touchdowns efficiency Average efficiency (EFF) percent_attempts_gte_eight_defenders Average % attempts 8+ Defenders Box (8+D%) avg_time_to_los Average time behind line scrimmage (TLOS) expected_rush_yards Average expected rush yards rush_yards_over_expected Average rush yards expected rush_yards_over_expected_per_att Average rush yards expected per attempt rush_pct_over_expected Average rush % expected","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"Dataframe RB Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"get_rb_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. running backs, stat_type defined rushing updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"RB Cumulative Season NFL Next Gen Stats (NGS) — get_rb_ngs_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"Obtain RB stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"","code":"get_rb_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"data frame 59 variables described . player_id Player gsis id (e.g., 00-0038120) player_display_name Player name (e.g., Breece Hall) player_name Player shortened name (e.g., B.Hall) position Player position (e.g., RB) team Player team (e.g., NYJ) games Number games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumbles Number rushes fumble rushing_fumbles_lost Number rushes lost fumble rushing_first_downs Number rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversions Two-point conversion rushes targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumbles Number fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_epa Expected points added receptions receiving_2pt_conversions Two-point conversion receptions racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards target_share Share targets player compared team targets tgt_pct Share targets percentage air_yards_share Share receiving_air_yards player team air_yards wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share completions Total pass completions (CMP) attempts Total pass attempts (ATT) cmp_pct Pass completion percentage passing_yards Total passing yards passing_tds Total passing touchdowns interceptions Total pass interceptions (INT) sacks Total number sacks taken sack_yards Total yards taken sacks sack_fumbles Total fumbles sacks sack_fumbles_lost Total fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downs First downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversions Two-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season(s) (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"Dataframe RB stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"function get_rb_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"RB Stats from NFL Play-by-Play Data — get_rb_pbp_stats","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"Obtain RB advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"","code":"get_rb_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"data frame 16 variables described . player_display_name Player name (e.g., Lamar Jackson) age position g Number games played gs Number games started att Total rush attempts yds Total rush yards td Total rush touchdowns x1d Rushing first downs ybc Rushing yards contact ybc_att Rushing yards contact per rushing attempt yac Rushing yards contact yac_att Rushing yards contact per attempt brk_tkl Broken tackles rushes att_br Rush attempts per broken tackle pfr_player_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"Dataframe RB advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"get_rb_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. running backs, stat_type defined rush. information available RB PFR advanced stats seasons PFR site PFR 2024 NFL Advanced Rushing.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"RB Advanced Season Stats from Pro Football Reference (PFR) — get_rb_pfr_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":null,"dir":"Reference","previous_headings":"","what":"Player Snap Share — get_snap_share","title":"Player Snap Share — get_snap_share","text":"Obtain player snap shares provided Pro Football Reference (PFR), starting 2012 season.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Player Snap Share — get_snap_share","text":"","code":"get_snap_share(season = NULL, pos = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Player Snap Share — get_snap_share","text":"pos Player position (str) seasons NFL Season(s) (int) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Player Snap Share — get_snap_share","text":"Obtain player snap share percentage positional group","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Player Snap Share — get_snap_share","text":"function loads game level snap counts PFR starting 2012 season. Snap count data utilized filter season player position. Additional data wrangling performed format player names order merge easily play--play data. information available snap counts Load Snap Counts PFR.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Player Snap Share — get_snap_share","text":"Nolan MacDonald playerPlayer name (e.g., Darnell Mooney) positionPlayer name (e.g., WR) teamPlayer team pfr_player_idPro Football Reference (PFR) player ID snapsNumber snaps snap_shareFraction total snaps snap_pctPercentage total snaps","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","title":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","text":"Obtain TE stats NFL cumulative season stats specified time frame either saved database nflreadr::load_pbp(). stats obtained using play--play data, NFL Next Gen Stats (NGS) Pro Football Reference (PFR).","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","text":"","code":"get_te_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","text":"data frame 61 variables described . player_id Player gsis id (e.g., 00-0034796) player_display_name Player name (e.g., Lamar Jackson) player_name Player shortened name (e.g., L.Jackson) pos Player position (e.g., QB) tm Player team (e.g., BAL) g Number games played tgt Number pass plays player targeted receiver PBP data rec Number pass receptions. Lateral receptions count reception PBP data rec_yds Yards gained pass reception. Includes yards gained receiving lateral play started pass play PBP data rec_td Number reception touchdowns, including receiving lateral play began pass play PBP data avg_yac Average yards catch (YAC) NGS avg_expected_yac Average expected yards catch (xYAC) NGS avg_yac_above_expectation Average yards catch expectation (+/-) NGS yac Yards catch (YAC) PFR yac_r Yards catch (YAC) per reception PFR adot Average depth target (ADOT) targeted, whether completed , PFR receiving_epa Expected points added receptions PBP data racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards PBP wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share PBP data avg_cushion Average cushion (CUSH) NGS avg_separation Average separation (SEP) NGS target_share Share targets player compared team targets PBP tgt_pct Share targets percentage PBP ybc Total yards passes traveled air caught yards catch (YBC) PFR ybc_r Yards catch per reception PFR receiving_air Receiving air yards including incomplete passes PBP data avg_intended_air_yards Average targeted air yards (TAY) NGS percent_share_of_intended_air_yards Average % share team's air yards (TAY%) NGS air_yards_share Share receiving_air_yards player team air_yards PBP data x1d_rec Number first downs gained reception PBP data brk_tkl Number broken tackles PFR rec_br Receptions per broken tackle PFR drop Number dropped passes PFR drop_percent Dropped pass percentage targeted PFR catch_percentage Average catch percentage NGS receiving_fumbles Number fumbles pass reception PBP data receiving_fumbles_lost Number fumbles lost pass reception PBP data receiving_2pt_conversions Two-point conversion receptions PBP data int_tgt Interceptions passes targetedfrom PFR rat Passer rating passes targeted PFR fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry PBP data rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt PBP data rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt PBP data rushing_fumbles Number rushes fumble PBP data rushing_fumbles_lost Number rushes lost fumble PBP data rushing_first_downs Number rushing first downs PBP data rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs PBP data rushing_2pt_conversions Two-point conversion rushes PBP data pfr_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","text":"Dataframe QB stats user-defined season(s) obtained NFL play--play data, Next Gen Stats (NGS) Pro Football Reference (PFR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","text":"function get_te_combined_stats_season can utilized obtain player stats season, including advanced stats. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season. Play--play data merged NFL Next Gen Stats (NGS) utilizing nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. Play--play data also merged advanced stats Pro Football Reference (PFR), beginning 2018. Note use function, seasons must 2018 later.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TE Cumulative Season Advanced Stats — get_te_combined_stats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"Obtain WR cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"","code":"get_te_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"data frame 16 variables described . player_id Player gsis id (e.g., 00-0037744) player_display_name Player name (e.g., Trey McBride) player_name Player shortened name (e.g., T.McBride) position Player position targets Total receiving targets receptions Total receptions yards Total receiving yards rec_touchdowns Total reception touchdowns avg_cushion Average cushion (CUSH) avg_separation Average separation (SEP) avg_intended_air_yards Average targeted air yards (TAY) avg_percent_share_of_intended_air_yards Average % share team's air yards (TAY%) avg_catch_percentage Average catch percentage avg_yac Average yards catch (YAC) avg_expected_yac Average expected yards catch (xYAC) avg_yac_above_expectation Average yards catch expectation (+/-)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"Dataframe TE Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"get_te_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. receivers, stat_type defined receiving updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TE Cumulative Season NFL Next Gen Stats (NGS) — get_te_ngs_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"Obtain TE stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"","code":"get_te_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"data frame 59 variables described . player_id Player gsis id (e.g., 00-0038120) player_display_name Player name (e.g., Breece Hall) player_name Player shortened name (e.g., B.Hall) position Player position (e.g., RB) team Player team (e.g., NYJ) games Number games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumbles Number fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_epa Expected points added receptions receiving_2pt_conversions Two-point conversion receptions racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards target_share Share targets player compared team targets tgt_pct Share targets percentage air_yards_share Share receiving_air_yards player team air_yards wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumbles Number rushes fumble rushing_fumbles_lost Number rushes lost fumble rushing_first_downs Number rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversions Two-point conversion rushes completions Total pass completions (CMP) attempts Total pass attempts (ATT) cmp_pct Pass completion percentage passing_yards Total passing yards passing_tds Total passing touchdowns interceptions Total pass interceptions (INT) sacks Total number sacks taken sack_yards Total yards taken sacks sack_fumbles Total fumbles sacks sack_fumbles_lost Total fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downs First downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversions Two-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season(s) (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"Dataframe TE stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"function get_te_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TE Stats from NFL Play-by-Play Data — get_te_pbp_stats","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"Obtain TE advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"","code":"get_te_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"data frame 22 variables described . player_display_name Player name (e.g., George Kittle) age Player age position Player position g Number games played gs Number games started tgt Total targets rec Total receptions yds Total receiving yards td Total receiving touchdowns x1d First downs receiving ybc Total yards passes traveled air caught yards catch (YBC) ybc_r Yards catch per reception yac Yards catch (YAC) yac_r Yards catch (YAC) per reception adot Average depth target (ADOT) targeted, whether completed . brk_tkl Number broken tackles rec_br Receptions per broken tackle drop Number dropped passes drop_percent Dropped pass percentage targeted int_tgt Interceptions passes targeted rat Passer rating passes targeted pfr_player_id Pro Football Reference player ID (e.g., KittGe00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"Dataframe TE advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"get_te_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. receivers, stat_type defined rec. information available TE PFR advanced stats seasons PFR site PFR 2024 NFL Advanced Receiving.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TE Advanced Season Stats from Pro Football Reference (PFR) — get_te_pfr_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","title":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","text":"Obtain WR stats NFL cumulative season stats specified time frame either saved database nflreadr::load_pbp(). stats obtained using play--play data, NFL Next Gen Stats (NGS) Pro Football Reference (PFR).","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","text":"","code":"get_wr_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","text":"data frame 61 variables described . player_id Player gsis id (e.g., 00-0034796) player_display_name Player name (e.g., Lamar Jackson) player_name Player shortened name (e.g., L.Jackson) pos Player position (e.g., QB) tm Player team (e.g., BAL) g Number games played tgt Number pass plays player targeted receiver PBP data rec Number pass receptions. Lateral receptions count reception PBP data rec_yds Yards gained pass reception. Includes yards gained receiving lateral play started pass play PBP data rec_td Number reception touchdowns, including receiving lateral play began pass play PBP data avg_yac Average yards catch (YAC) NGS avg_expected_yac Average expected yards catch (xYAC) NGS avg_yac_above_expectation Average yards catch expectation (+/-) NGS yac Yards catch (YAC) PFR yac_r Yards catch (YAC) per reception PFR adot Average depth target (ADOT) targeted, whether completed , PFR receiving_epa Expected points added receptions PBP data racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards PBP wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share PBP data avg_cushion Average cushion (CUSH) NGS avg_separation Average separation (SEP) NGS target_share Share targets player compared team targets PBP tgt_pct Share targets percentage PBP ybc Total yards passes traveled air caught yards catch (YBC) PFR ybc_r Yards catch per reception PFR receiving_air Receiving air yards including incomplete passes PBP data avg_intended_air_yards Average targeted air yards (TAY) NGS percent_share_of_intended_air_yards Average % share team's air yards (TAY%) NGS air_yards_share Share receiving_air_yards player team air_yards PBP data x1d_rec Number first downs gained reception PBP data brk_tkl Number broken tackles PFR rec_br Receptions per broken tackle PFR drop Number dropped passes PFR drop_percent Dropped pass percentage targeted PFR catch_percentage Average catch percentage NGS receiving_fumbles Number fumbles pass reception PBP data receiving_fumbles_lost Number fumbles lost pass reception PBP data receiving_2pt_conversions Two-point conversion receptions PBP data int_tgt Interceptions passes targetedfrom PFR rat Passer rating passes targeted PFR fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry PBP data rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt PBP data rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt PBP data rushing_fumbles Number rushes fumble PBP data rushing_fumbles_lost Number rushes lost fumble PBP data rushing_first_downs Number rushing first downs PBP data rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs PBP data rushing_2pt_conversions Two-point conversion rushes PBP data pfr_id Pro Football Reference player ID (e.g., JackLa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","text":"Dataframe QB stats user-defined season(s) obtained NFL play--play data, Next Gen Stats (NGS) Pro Football Reference (PFR)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","text":"function get_wr_combined_stats_season can utilized obtain player stats season, including advanced stats. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season. Play--play data merged NFL Next Gen Stats (NGS) utilizing nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. Play--play data also merged advanced stats Pro Football Reference (PFR), beginning 2018. Note use function, seasons must 2018 later.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"WR Cumulative Season Advanced Stats — get_wr_combined_stats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"Obtain WR cumulative season stats nflreadr, acquire Next Gen Stats (NGS) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"","code":"get_wr_ngs_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"data frame 16 variables described . player_id Player gsis id (e.g., 00-0039337) player_display_name Player name (e.g., Malik Nabers) player_name Player shortened name (e.g., M.Nabers) position Player position targets Total receiving targets receptions Total receptions yards Total receiving yards rec_touchdowns Total reception touchdowns avg_cushion Average cushion (CUSH) avg_separation Average separation (SEP) avg_intended_air_yards Average targeted air yards (TAY) percent_share_of_intended_air_yards Average % share team's air yards (TAY%) catch_percentage Average catch percentage avg_yac Average yards catch (YAC) avg_expected_yac Average expected yards catch (xYAC) avg_yac_above_expectation Average yards catch expectation (+/-)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"seasons NFL Season(s) seasons = 2024 seasons = c(2023, 2024)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"Dataframe WR Next Gen Stats defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"get_wr_ngs_advstats_season function obtain NFL Next Gen Stats (NGS) entire season multiple seasons. function utilizes nflreadr function load_nextgen_stats load player level weekly stats starting 2016 season. receivers, stat_type defined receiving updated every night. NGS provide data players minimum number receptions. information available NGS stats NGS glossary.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"WR Cumulative Season NFL Next Gen Stats (NGS) — get_wr_ngs_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"Obtain WR stats NFL play--play data specified time frame either saved database nflreadr::load_pbp().","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"","code":"get_wr_pbp_stats( pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL, week_min = NULL, week_max = NULL )"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"data frame 59 variables described . player_id Player gsis id (e.g., 00-0038120) player_display_name Player name (e.g., Breece Hall) player_name Player shortened name (e.g., B.Hall) position Player position (e.g., RB) team Player team (e.g., NYJ) games Number games played fpts_std_4pt_td Fantasy points standard format 4 point TD ppg_std_4pt_td Fantasy points per game standard format 4 point TD fpts_half_ppr_4pt_td Fantasy points half PPR format 4 point TD ppg_half_ppr_4pt_td Fantasy points per game half PPR format 4 point TD fpts_ppr_4pt_td Fantasy points full PPR format 4 point TD ppg_ppr_4pt_td Fantasy points per game full PPR format 4 point TD fpts_std_6pt_td Fantasy points standard format 6 point TD ppg_std_6pt_td Fantasy points per game standard format 6 point TD fpts_half_ppr_6pt_td Fantasy points half PPR format 6 point TD ppg_half_ppr_6pt_td Fantasy points per game half PPR format 6 point TD fpts_ppr_6pt_td Fantasy points full PPR format 6 point TD ppg_ppr_6pt_td Fantasy points per game full PPR format 6 point TD targets Number pass plays player targeted receiver receptions Number pass receptions. Lateral receptions count reception receiving_yards Yards gained pass reception. Includes yards gained receiving lateral play started pass play receiving_tds Number reception touchdowns, including receiving lateral play began pass play receiving_fumbles Number fumbles pass reception receiving_fumbles_lost Number fumbles lost pass reception receiving_air_yards Receiving air yards including incomplete passes receiving_yards_after_catch Yards catch gained plays player receiver (unofficial stat may differ slightly different sources) receiving_first_downs Number first downs gained reception receiving_epa Expected points added receptions receiving_2pt_conversions Two-point conversion receptions racr Receiving Air Conversion Ratio. RACR = receiving_yards / receiving_air_yards target_share Share targets player compared team targets tgt_pct Share targets percentage air_yards_share Share receiving_air_yards player team air_yards wopr Weighted Opportunity Rating. WOPR = 1.5 x target_share + 0.7 x air_yards_share carries Number rush attempts including scrambles kneel downs. Rushes lateral reception count carry rushing_yards Yards gained rushing including scrambles kneel downs. Also includes yards gained obtaining lateral play started rushing attempt rushing_tds number rushing touchdowns (incl. scrambles). Also includes touchdowns obtaining lateral play started rushing attempt rushing_fumbles Number rushes fumble rushing_fumbles_lost Number rushes lost fumble rushing_first_downs Number rushing first downs rushing_epa Expected points added (EPA) rush attempts including scrambles kneel downs rushing_2pt_conversions Two-point conversion rushes completions Total pass completions (CMP) attempts Total pass attempts (ATT) cmp_pct Pass completion percentage passing_yards Total passing yards passing_tds Total passing touchdowns interceptions Total pass interceptions (INT) sacks Total number sacks taken sack_yards Total yards taken sacks sack_fumbles Total fumbles sacks sack_fumbles_lost Total fumbles lost sacks passing_air_yards Passing air yards (includes incomplete passes) passing_yards_after_catch Yards catch gained plays player passer (unofficial stat may differ slightly different sources). passing_first_downs First downs pass attempts passing_epa Total expected points added (EPA) pass attempts sacks. NOTE: uses variable qb_epa, gives QB credit EPA point receiver lost fumble completed catch makes EPA work like passing yards plays fumbles passing_2pt_conversions Two-point conversion passes pacr Passing Air Conversion Ratio. PACR = passing_yards / passing_air_yards dakota Adjusted EPA + CPOE composite based coefficients best predicts adjusted EPA/play following year","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"pbp_db_tbl Play--Play database table name (optional) seasons NFL season(s) (required) obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) week_min Minimum week (required) define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week (optional) define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path (optional)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"Dataframe WR stats user-defined season(s) week(s) obtained NFL play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"function get_wr_pbp_stats can utilized obtain player stats specified time frame can include multiple seasons even range weeks instead entire season. includes stats passing, rushing, receiving obtained using nflfastR function calculate_player_stats(). player stats utilized calculate fantasy points based common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). function acquires stats using cumulative play--play data either loading saved database using nflreadr::load_pbp(). data obtained user-defined season multiple seasons. range weeks can also defined week_min week_max. entire season desired, use week_min = 1 week_max need defined. specify loading database, define path database pbp_db well name table load pbp_db_tbl. load database, need save play--play data database using nflfastR function, update_db(). example, database saved default pbp_db table stored containing play--play information called nflfastR_pbp. Assume database saved project_name/data/. Using default naming scheme, nuclearff::get_pbp_data can defined using database pbp_db = \"data/pbp_db\" pbp_db_tbl = \"nflfastR_pbp\". Note two arguments must defined strings. information calculated player stats, refer nflfastR calculate_player_stats()","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"WR Stats from NFL Play-by-Play Data — get_wr_pbp_stats","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":null,"dir":"Reference","previous_headings":"","what":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"Obtain WR advanced season stats nflreadr, acquire Pro Football Reference (PFR) data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"","code":"get_wr_pfr_advstats_season(seasons = NULL)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"data frame 22 variables described . player_display_name Player name (e.g., Malik Nabers) age Player age position Player position g Number games played gs Number games started tgt Total targets rec Total receptions yds Total receiving yards td Total receiving touchdowns x1d First downs receiving ybc Total yards passes traveled air caught yards catch (YBC) ybc_r Yards catch per reception yac Yards catch (YAC) yac_r Yards catch (YAC) per reception adot Average depth target (ADOT) targeted, whether completed . brk_tkl Number broken tackles rec_br Receptions per broken tackle drop Number dropped passes drop_percent Dropped pass percentage targeted int_tgt Interceptions passes targeted rat Passer rating passes targeted pfr_player_id Pro Football Reference player ID (e.g., NabeMa00)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"seasons NFL Season(s) seasons = 2024","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"Dataframe WR advanced stats Pro Football Reference (PFR) defined season","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"get_wr_pfr_advstats_season function obtain advanced stats Pro Football Reference (PFR). function utilizes nflreadr function load_pfr_advstats load player level season stats starting 2018 season. receivers, stat_type defined rec. information available WR PFR advanced stats seasons PFR site PFR 2024 NFL Advanced Receiving.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"WR Advanced Season Stats from Pro Football Reference (PFR) — get_wr_pfr_advstats_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Load Play-by-Play Data from Database — load_data_from_db","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Helper function load play--play data nflreadr specified time frame.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"","code":"load_data_from_db(pbp_db, pbp_db_tbl, season, week_min, week_max)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"pbp_db_tbl Play--Play database table name season NFL season obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week define range weeks pull NFL season. defined, data pulled weeks, beginning week_min. pbp_dp Play--Play database path","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Dataframe containing filtered play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Helper function load play--play data database. function filters data include specified time frame including seasons range weeks. week_max provided, filter week_min week_max week_max provided, filter weeks >= week_min get remainder season. function typically utilized user desires loading play--play data database defined pbp_db pbp_db_tbl strings.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_db.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Load Play-by-Play Data from Database — load_data_from_db","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Helper function load play--play data nflreadr specified time frame.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"","code":"load_data_from_nflreadr(season, week_min, week_max)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"season NFL season obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024. week_min Minimum week define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week define range weeks pull NFL season. defined, data pulled weeks, beginning week_min.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Dataframe containing filtered play--play data","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Helper function load play--play data nflreadr. function filters data include specified time frame including seasons range weeks. week_max provided, filter week_min week_max week_max provided, filter weeks >= week_min get remainder season. function typically utilized user loading play--play data database.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/load_data_from_nflreadr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Load Play-by-Play Data from nflreadr — load_data_from_nflreadr","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Cleanup Player Names — replace_player_names","title":"Helper - Cleanup Player Names — replace_player_names","text":"String parsing helper cleanup player names continuity.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Cleanup Player Names — replace_player_names","text":"","code":"replace_player_names(df, player_col = \"player\")"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Cleanup Player Names — replace_player_names","text":"df Dataframe player column clean names","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Cleanup Player Names — replace_player_names","text":"Dataframe cleaned player names","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Cleanup Player Names — replace_player_names","text":"function replace_player_names reads dataframe includes player names uses str_replace clean names. can used across package joining data player names . function strips names suffixes like Jr., Sr., II, III. Also, first names abbreviations like D.J. Moore D.K. Metcalf periods stripped initials. player names specified say . specific cases defined explicitly.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_player_names.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Cleanup Player Names — replace_player_names","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Cleanup Team Abbreviations — replace_team_names","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"String parsing helper cleanup team abbreviations continuity.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"","code":"replace_team_names(df)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"df Dataframe team column clean abbreviations","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"Dataframe cleaned team abbreviations","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"function team_player_names reads dataframe includes team names team uses str_replace replace team abbreviation. can used across package joining data team names . Team specific cases defined explicitly, alleviate issue data differences. example, nflreadr roster data lists Los Angeles Rams LA, nflfastR play--play data lists abbreviation LAR.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/replace_team_names.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Cleanup Team Abbreviations — replace_team_names","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"Validation helper determine seasons argument obtain NGS 2016 later.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"","code":"validate_ngs_season(season)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"season NFL season obtain NGS data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"Validate season defined integer 2016 greater","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"function validate_ngs_season can utilized validate whether arguments season appropriate NFL NGS dates back 2016. season defined prior 2016, error occur.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_ngs_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate NFL Next Gen Stats (NGS) Data Seasons — validate_ngs_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"Validation helper determine path play--play database, pbp_db, database table name, pbp_db_tbl, defined strings.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"","code":"validate_pbp_db(pbp_db, pbp_db_tbl)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"pbp_db_tbl Play--Play database table name (str) pbp_dp Play--Play database path (str)","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"Validate pbp_db pbp_db_tbl strings","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"function validate_pbp_db can utilized validate whether arguments load database get_pbp_data valid defined strings.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_db.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Play-by-Play Database Path and Table Arguments — validate_pbp_db","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"Validation helper determine seasons argument obtain play--play database 1999 later.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"","code":"validate_pbp_season(season)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"season NFL season obtain play--play data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"Validate season defined integer 1999 greater","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"function validate_pbp_season can utilized validate whether arguments season appropriate NFL play--play data dates back 1999. season defined prior 1999, error occur.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Play-by-Play Data Seasons — validate_pbp_season","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"Validation helper determine weeks defined properly filter play--play data.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"","code":"validate_pbp_weeks(week_min, week_max)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"week_min Minimum week define whether pulling range weeks entire season. Use week_min = 1 first week season, must integer. week_max Maximum week define range weeks pull NFL season. defined, data pulled weeks, beginning week_min.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"Validate weeks defined integers","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"function validate_pbp_weeks utilized determine weeks defined integers week_min week_max.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pbp_weeks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Arguments for Weeks — validate_pbp_weeks","text":"Nolan MacDonald","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"Validation helper determine seasons argument obtain PFR 2018 later.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"","code":"validate_pfr_season(season)"},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"season NFL season obtain NGS data. season can defined single season, season = 2024. multiple seasons, use either season = c(2023,2024) season = 2022:2024.","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"Validate season defined integer 2018 greater","code":""},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"function validate_pfr_season can utilized validate whether arguments season appropriate PFR advanced stats dates back 2018. season defined prior 2018, error occur.","code":""},{"path":[]},{"path":"https://github.com/NuclearAnalyticsLab/nuclearff/reference/validate_pfr_season.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper - Validate Pro Football Reference (PFR) Advanced Stats Seasons — validate_pfr_season","text":"Nolan MacDonald","code":""}] diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 9bc29f0..61a8d27 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -10,16 +10,20 @@ https://github.com/NuclearAnalyticsLab/nuclearff/reference/calc_fpts_ppg_common_formats.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_pbp_data.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_player_data.html +https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_combined_stats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_ngs_advstats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pbp_stats.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_qb_pfr_advstats_season.html +https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_combined_stats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_ngs_advstats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pbp_stats.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_rb_pfr_advstats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_snap_share.html +https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_combined_stats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_ngs_advstats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pbp_stats.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_te_pfr_advstats_season.html +https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_combined_stats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_ngs_advstats_season.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pbp_stats.html https://github.com/NuclearAnalyticsLab/nuclearff/reference/get_wr_pfr_advstats_season.html diff --git a/man/calc_fpts.Rd b/man/calc_fpts.Rd index 842f750..49908f0 100644 --- a/man/calc_fpts.Rd +++ b/man/calc_fpts.Rd @@ -16,11 +16,12 @@ calc_fpts(pbp = pbp, pass_td_pts = 6, pass_int_pts = -2, rec_pts = 1) \item{rec_pts}{Reception Points} } \value{ -Calculate fantasy points using play-by-play and data and user-defined +Dataframe with total fantasy points using play-by-play data and user-defined scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR) } \description{ -Calculate Fantasy Points +Calculate fantasy points using play-by-play and data and user-defined +scoring settings (e.g., 6PT PASS TD, -2 PASS INT, Full PPR) } \author{ Nolan MacDonald diff --git a/man/calc_fpts_common_formats.Rd b/man/calc_fpts_common_formats.Rd index 7efb630..30083c6 100644 --- a/man/calc_fpts_common_formats.Rd +++ b/man/calc_fpts_common_formats.Rd @@ -3,16 +3,73 @@ \name{calc_fpts_common_formats} \alias{calc_fpts_common_formats} \title{Calculate Fantasy Points for Common Scoring Formats} +\format{ +A data frame with 79 variables that are described below. +\describe{ +\item{\code{fpts_std_4pt_td}}{ +Total fantasy points for standard scoring with 4 point touchdowns +} +\item{\code{ppg_std_4pt_td}}{ +Points per game (PPG) for standard scoring with 4 point touchdowns +} +\item{\code{fpts_half_ppr_4pt_td}}{ +Total fantasy points for half point per reception (Half PPR) scoring +with 4 point touchdowns +} +\item{\code{ppg_half_ppr_4pt_td}}{ +Points per game (PPG) for half point per reception (Half PPR) scoring +with 4 point touchdowns +} +\item{\code{fpts_ppr_4pt_td}}{ +Total fantasy points for point per reception (full PPR) scoring with +4 point touchdowns +} +\item{\code{ppg_ppr_4pt_td}}{ +Points per game (PPG) for point per reception (Full PPR) scoring +with 4 point touchdowns +} +\item{\code{fpts_std_6pt_td}}{ +Total fantasy points for standard scoring with 6 point touchdowns +} +\item{\code{ppg_std_6pt_td}}{ +Points per game (PPG) for standard scoring with 6 point touchdowns +} +\item{\code{fpts_half_ppr_6pt_td}}{ +Total fantasy points for half point per reception (Half PPR) scoring +with 6 point touchdowns +} +\item{\code{ppg_half_ppr_6pt_td}}{ +Points per game (PPG) for half point per reception (Half PPR) scoring +with 6 point touchdowns +} +\item{\code{fpts_ppr_6pt_td}}{ +Total fantasy points for point per reception (full PPR) scoring with +6 point touchdowns +} +\item{\code{ppg_ppr_6pt_td}}{ +Points per game (PPG) for point per reception (Full PPR) scoring +with 6 point touchdowns +} +} +} \usage{ calc_fpts_common_formats(pbp = pbp) } \arguments{ -\item{pbp}{Play-by-play Dataframe} +\item{pbp}{Play-by-play Data frame} } \value{ -Calculate fantasy points using play-by-play and data and common +Data frame with total fantasy points for common scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) } \description{ -Calculate Fantasy Points for Common Scoring Formats +Calculate fantasy points using play-by-play data and common +scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) +} +\seealso{ +\code{\link[nuclearff]{calc_fpts}} +Calculate total fantasy points +} +\author{ +Nolan MacDonald } diff --git a/man/calc_fpts_ppg_common_formats.Rd b/man/calc_fpts_ppg_common_formats.Rd index 5c1087d..2080810 100644 --- a/man/calc_fpts_ppg_common_formats.Rd +++ b/man/calc_fpts_ppg_common_formats.Rd @@ -10,9 +10,13 @@ calc_fpts_ppg_common_formats(pbp = pbp) \item{pbp}{Play-by-play Dataframe} } \value{ -Calculate fantasy points per game using play-by-play and data and common +Dataframe with fantasy points per game (PPG) using common scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) } \description{ -Calculate Fantasy Points Per Game for Common Scoring Formats +Calculate fantasy points per game using play-by-play and data and common +scoring settings (i.e., 4/6PT PASS TD, -2 PASS INT, STD/Half PPR/Full PPR) +} +\author{ +Nolan MacDonald } diff --git a/man/get_player_data.Rd b/man/get_player_data.Rd index 224ae77..c286ed9 100644 --- a/man/get_player_data.Rd +++ b/man/get_player_data.Rd @@ -4,12 +4,12 @@ \alias{get_player_data} \title{Player Identification Data} \usage{ -get_player_data(season = NULL, pos = NULL) +get_player_data(seasons = NULL, position = NULL) } \arguments{ -\item{season}{NFL season or year (int)} +\item{seasons}{NFL season or year (int)} -\item{pos}{Player position (str) such as "WR"} +\item{position}{Player position (str) such as "WR"} } \value{ Dataframe that lists player data for a specified season and position diff --git a/man/get_qb_combined_stats_season.Rd b/man/get_qb_combined_stats_season.Rd new file mode 100644 index 0000000..a8eaf76 --- /dev/null +++ b/man/get_qb_combined_stats_season.Rd @@ -0,0 +1,237 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_combined_stats_season.R +\name{get_qb_combined_stats_season} +\alias{get_qb_combined_stats_season} +\title{QB Cumulative Season Advanced Stats} +\format{ +A data frame with 79 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +\item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +\item{\code{pos}}{Player position (e.g., QB)} +\item{\code{tm}}{Player team (e.g., BAL)} +\item{\code{g}}{Number of games played} +\item{\code{completions}}{Total pass completions (CMP)from PBP data} +\item{\code{attempts}}{Total pass attempts (ATT)from PBP data} +\item{\code{cmp_pct}}{Pass completion percentage from PBP data} +\item{\code{expected_completion_percentage}}{ +Expected completion percentage from NGS +} +\item{\code{completion_percentage_above_expectation}}{ +Average expected completion percentage (xCOMP) from NGS +} +\item{\code{passing_yards}}{Total passing yards from PBP data} +\item{\code{passing_tds}}{Total passing touchdowns from PBP data} +\item{\code{interceptions}}{Total pass interceptions (INT) from PBP data} +\item{\code{passing_epa}}{ +Total expected points added (EPA) on pass attempts and sacks. +NOTE: This uses the variable \code{qb_epa}, which gives QB credit for EPA for +up to the point where a receiver lost a fumble after a completed catch +and makes EPA work more like passing yards on plays with fumbles +} +\item{\code{passer_rating}}{Average passer rating from NGS} +\item{\code{pacr}}{ +Passing Air Conversion Ratio. +PACR = \code{passing_yards} / \code{passing_air_yards} from PBP data +} +\item{\code{dakota}}{ +Adjusted EPA + CPOE composite based on coefficients which best predicts +adjusted EPA/play in the following year from PBP data +} +\item{\code{aggressiveness}}{Average aggressiveness (AGG\%) from NGS} +\item{\code{passing_air_yards}}{ +Passing air yards (includes incomplete passes) from PBP data +} +\item{\code{passing_yards_after_catch}}{ +Yards after the catch gained on plays in which player was the passer +(this is an unofficial stat and may differ slightly between different +sources) from PBP data +} +\item{\code{avg_air_distance}}{Average air distance from NGS} +\item{\code{max_air_distance}}{Maximum or longest air distance from NGS} +\item{\code{avg_time_to_throw}}{Average time to throw (TT) from NGS} +\item{\code{avg_completed_air_yards}}{ +Average completed air yards (CAY) from NGS +} +\item{\code{avg_intended_air_yards}}{ +Average intended air yards (IAY) from NGS +} +\item{\code{avg_air_yards_differential}}{ +Average air yards differential (AYD) from NGS +} +\item{\code{max_completed_air_distance}}{ +Maximum or longest completed air distance (LCAD) from NGS +} +\item{\code{avg_air_yards_to_sticks}}{ +Average air yards to the sticks (AYTS) from NGS +} +\item{\code{passing_first_downs}}{ +First downs on pass attempts from PBP data +} +\item{\code{throwaways}}{Number of throwaways from PFR} +\item{\code{spikes}}{Number of spikes from PFR} +\item{\code{drops}}{Number of throws dropped from PFR} +\item{\code{drop_pct}}{Percentage of dropped throws from PFR} +\item{\code{bad_throws}}{Number of bad throws from PFR} +\item{\code{bad_throw_pct}}{Percentage of bad throws from PFR} +\item{\code{pocket_time}}{Average time in pocket from PFR} +\item{\code{times_blitzed}}{Number of times blitzed from PFR} +\item{\code{times_hurried}}{Number of times hurried from PFR} +\item{\code{times_hit}}{Number of times hit from PFR} +\item{\code{times_pressured}}{Number of times pressured from PFR} +\item{\code{pressure_pct}}{Percent of time pressured from PFR} +\item{\code{batted_balls}}{Number of batted balls from PFR} +\item{\code{on_tgt_throws}}{Number of throws on target from PFR} +\item{\code{on_tgt_pct}}{Percent of throws on target from PFR} +\item{\code{rpo_plays}}{Run-pass-option (RPO) number of plays from PFR} +\item{\code{rpo_yards}}{Run-pass-option (RPO) total yards from PFR} +\item{\code{rpo_pass_att}}{Run-pass-option (RPO) pass attempts from PFR} +\item{\code{rpo_pass_yards}}{Run-pass-option (RPO) pass yards from PFR} +\item{\code{rpo_rush_att}}{Run-pass-option (RPO) rush attempts from PFR} +\item{\code{rpo_rush_yards}}{Run-pass-option (RPO) rush yards from PFR} +\item{\code{pa_pass_att}}{Play action pass attempts from PFR} +\item{\code{pa_pass_yards}}{Play action pass yards from PFR} +\item{\code{passing_2pt_conversions}}{ +Two-point conversion passes from PBP data +} +\item{\code{sacks}}{Total number of sacks taken from PBP data} +\item{\code{sack_yards}}{Total yards taken from sacks from PBP data} +\item{\code{sack_fumbles}}{Total fumbles from sacks from PBP data} +\item{\code{sack_fumbles_lost}}{Total fumbles lost from sacks from PBP data} +\item{\code{carries}}{ +Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data +} +\item{\code{rushing_yards}}{ +Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data +} +\item{\code{rushing_tds}}{ +The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data +} +\item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +\item{\code{rushing_fumbles_lost}}{ +Number of rushes with a lost fumble from PBP data +} +\item{\code{rushing_first_downs}}{ +Number of rushing first downs from PBP data +} +\item{\code{rushing_epa}}{ +Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data +} +\item{\code{rushing_2pt_conversions}}{ +Two-point conversion rushes from PBP data +} +\item{\code{fpts_std_4pt_td}}{ +Total fantasy points for standard scoring with 4 point touchdowns +} +\item{\code{ppg_std_4pt_td}}{ +Points per game (PPG) for standard scoring with 4 point touchdowns +} +\item{\code{fpts_half_ppr_4pt_td}}{ +Total fantasy points for half point per reception (Half PPR) scoring +with 4 point touchdowns +} +\item{\code{ppg_half_ppr_4pt_td}}{ +Points per game (PPG) for half point per reception (Half PPR) scoring +with 4 point touchdowns +} +\item{\code{fpts_ppr_4pt_td}}{ +Total fantasy points for point per reception (full PPR) scoring with +4 point touchdowns +} +\item{\code{ppg_ppr_4pt_td}}{ +Points per game (PPG) for point per reception (Full PPR) scoring +with 4 point touchdowns +} +\item{\code{fpts_std_6pt_td}}{ +Total fantasy points for standard scoring with 6 point touchdowns +} +\item{\code{ppg_std_6pt_td}}{ +Points per game (PPG) for standard scoring with 6 point touchdowns +} +\item{\code{fpts_half_ppr_6pt_td}}{ +Total fantasy points for half point per reception (Half PPR) scoring +with 6 point touchdowns +} +\item{\code{ppg_half_ppr_6pt_td}}{ +Points per game (PPG) for half point per reception (Half PPR) scoring +with 6 point touchdowns +} +\item{\code{fpts_ppr_6pt_td}}{ +Total fantasy points for point per reception (full PPR) scoring with +6 point touchdowns +} +\item{\code{ppg_ppr_6pt_td}}{ +Points per game (PPG) for point per reception (Full PPR) scoring +with 6 point touchdowns +} +\item{\code{pfr_id}}{ +Pro Football Reference player ID (e.g., JackLa00) +} +} +} +\usage{ +get_qb_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +} +\description{ +Obtain QB stats from NFL cumulative season stats for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR). +} +\details{ +The function \code{get_qb_combined_stats_season} can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +\code{nflreadr} function \code{load_nextgen_stats} to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, \code{seasons} must be 2018 or later. +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database + +\code{\link[nflreadr]{load_nextgen_stats}} +Load player level weekly NFL Next Gen Stats + +\code{\link[nflreadr]{load_pfr_advstats}} +Load advanced stats from PFR +} +\author{ +Nolan MacDonald +} diff --git a/man/get_qb_ngs_advstats_season.Rd b/man/get_qb_ngs_advstats_season.Rd index 2242025..5b2c1b0 100644 --- a/man/get_qb_ngs_advstats_season.Rd +++ b/man/get_qb_ngs_advstats_season.Rd @@ -3,6 +3,40 @@ \name{get_qb_ngs_advstats_season} \alias{get_qb_ngs_advstats_season} \title{QB Cumulative Season NFL Next Gen Stats (NGS)} +\format{ +A data frame with 33 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +\item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +\item{\code{position}}{Player position} +\item{\code{pass_yards}}{Total pass yards} +\item{\code{pass_touchdowns}}{Total pass touchdowns} +\item{\code{interceptions}}{Total interceptions} +\item{\code{passer_rating}}{Average passer rating} +\item{\code{attempts}}{Total pass attempts} +\item{\code{completions}}{Total pass completions} +\item{\code{completion_percentage}}{Average completion percentage (\%)} +\item{\code{expected_completion_percentage}}{Expected completion percentage} +\item{\code{completion_percentage_above_expectation}}{ +Average expected completion percentage (xCOMP) +} +\item{\code{avg_air_distance}}{Average air distance} +\item{\code{max_air_distance}}{Maximum or longest air distance} +\item{\code{avg_time_to_throw}}{Average time to throw (TT)} +\item{\code{avg_completed_air_yards}}{Average completed air yards (CAY)} +\item{\code{avg_intended_air_yards}}{Average intended air yards (IAY)} +\item{\code{avg_air_yards_differential}}{ +Average air yards differential (AYD) +} +\item{\code{aggressiveness}}{Average aggressiveness (AGG\%)} +\item{\code{max_completed_air_distance}}{ +Maximum or longest completed air distance (LCAD)} +\item{\code{avg_air_yards_to_sticks}}{ +Average air yards to the sticks (AYTS) +} +} +} \usage{ get_qb_ngs_advstats_season(seasons = NULL) } @@ -34,36 +68,4 @@ Load player level weekly NFL Next Gen Stats } \author{ Nolan MacDonald - -\itemize{ -\item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} -\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} -\item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} -\item{\code{position}}{Player position} -\item{\code{pass_yards}}{Total pass yards} -\item{\code{pass_touchdowns}}{Total pass touchdowns} -\item{\code{interceptions}}{Total interceptions} -\item{\code{passer_rating}}{Average passer rating} -\item{\code{attempts}}{Total pass attempts} -\item{\code{completions}}{Total pass completions} -\item{\code{completion_percentage}}{Average completion percentage (\%)} -\item{\code{expected_completion_percentage}}{} -\item{\code{completion_percentage_above_expectation}}{ -Average expected completion percentage (xCOMP) -} -\item{\code{avg_air_distance}}{Average air distance} -\item{\code{max_air_distance}}{Maximum or longest air distance} -\item{\code{avg_time_to_throw}}{Average time to throw (TT)} -\item{\code{avg_completed_air_yards}}{Average completed air yards (CAY)} -\item{\code{avg_intended_air_yards}}{Average intended air yards (IAY)} -\item{\code{avg_air_yards_differential}}{ -Average air yards differential (AYD) -} -\item{\code{aggressiveness}}{Average aggressiveness (AGG\%)} -\item{\code{max_completed_air_distance}}{ -Maximum or longest completed air distance (LCAD)} -\item{\code{avg_air_yards_to_sticks}}{ -Average air yards to the sticks (AYTS) -} -} } diff --git a/man/get_qb_pbp_stats.Rd b/man/get_qb_pbp_stats.Rd index 027f292..0792b3c 100644 --- a/man/get_qb_pbp_stats.Rd +++ b/man/get_qb_pbp_stats.Rd @@ -3,82 +3,9 @@ \name{get_qb_pbp_stats} \alias{get_qb_pbp_stats} \title{QB Stats from NFL Play-by-Play Data} -\usage{ -get_qb_pbp_stats( - pbp_db = NULL, - pbp_db_tbl = NULL, - season = NULL, - week_min = NULL, - week_max = NULL -) -} -\arguments{ -\item{pbp_db_tbl}{Play-by-Play database table name (optional)} - -\item{season}{NFL season (required) to obtain play-by-play data. The -season can be defined as a single season, \code{season = 2024}. For multiple -seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} - -\item{week_min}{Minimum week (required) to define whether pulling a range -of weeks or the entire season. Use \code{week_min = 1} for the first week of -the season, must be an integer.} - -\item{week_max}{Maximum week (optional) to define a range of weeks to pull -from an NFL season. If not defined, the data will be pulled for all weeks, -beginning with \code{week_min}.} - -\item{pbp_dp}{Play-by-Play database path (optional)} -} -\value{ -Dataframe with QB stats for user-defined season(s) and week(s) -obtained from NFL play-by-play data -} -\description{ -Obtain QB stats from NFL play-by-play data for a specified time frame -from either a saved database or \code{nflreadr::load_pbp()}. -} -\details{ -The function \code{get_qb_pbp_stats} can be utilized to obtain player stats -for a specified time frame that can include multiple seasons or even a -range of weeks instead of the entire season. -This includes stats for passing, rushing, and receiving obtained by using -the \code{nflfastR} function \code{calculate_player_stats()}. -The player stats are utilized to calculate fantasy points -based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). -The function acquires stats by using cumulative play-by-play data -by either loading from a saved database or using \code{nflreadr::load_pbp()}. -The data is obtained for a user-defined season or multiple seasons. -A range of weeks can also be defined with \code{week_min} and \code{week_max}. -If the entire season is desired, use \code{week_min = 1} and \code{week_max} does -not need to be defined. -To specify loading from a database, define the path to the database with -\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. -To load from a database, you will need to save play-by-play data to a -database using the \code{nflfastR} function, \code{update_db()}. -For example, the database is saved by default as \code{pbp_db} with a table that -is stored containing all play-by-play information called \code{nflfastR_pbp}. -Assume that the database is saved in \verb{project_name/data/}. -Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the -database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. -Note that these two arguments must be defined as strings. -For more information on calculated player stats, refer to the -\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} -} -\seealso{ -\code{\link[nuclearff]{nuclearff::get_pbp_data}} -Obtain play-by-play data for a specified time frame from either a saved -database or if not defined, using \code{nflreadr::load_pbp()}, - -\code{\link[nflreadr]{load_pbp}} -Load play-by-play data, - -\code{\link[nflfastR]{update_db}} -Update or Create a nflfastR Play-by-Play Database -} -\author{ -Nolan MacDonald - -\itemize{ +\format{ +A data frame with 57 variables that are described below. +\describe{ \item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} \item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} @@ -207,3 +134,78 @@ Number of first downs gained on a reception \item{\code{receiving_2pt_conversions}}{Two-point conversion receptions} } } +\usage{ +get_qb_pbp_stats( + pbp_db = NULL, + pbp_db_tbl = NULL, + seasons = NULL, + week_min = NULL, + week_max = NULL +) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season(s) (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} + +\item{week_min}{Minimum week (required) to define whether pulling a range +of weeks or the entire season. Use \code{week_min = 1} for the first week of +the season, must be an integer.} + +\item{week_max}{Maximum week (optional) to define a range of weeks to pull +from an NFL season. If not defined, the data will be pulled for all weeks, +beginning with \code{week_min}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with QB stats for user-defined season(s) and week(s) +obtained from NFL play-by-play data +} +\description{ +Obtain QB stats from NFL play-by-play data for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. +} +\details{ +The function \code{get_qb_pbp_stats} can be utilized to obtain player stats +for a specified time frame that can include multiple seasons or even a +range of weeks instead of the entire season. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season or multiple seasons. +A range of weeks can also be defined with \code{week_min} and \code{week_max}. +If the entire season is desired, use \code{week_min = 1} and \code{week_max} does +not need to be defined. +To specify loading from a database, define the path to the database with +\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. +To load from a database, you will need to save play-by-play data to a +database using the \code{nflfastR} function, \code{update_db()}. +For example, the database is saved by default as \code{pbp_db} with a table that +is stored containing all play-by-play information called \code{nflfastR_pbp}. +Assume that the database is saved in \verb{project_name/data/}. +Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the +database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. +Note that these two arguments must be defined as strings. +For more information on calculated player stats, refer to the +\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database +} +\author{ +Nolan MacDonald +} diff --git a/man/get_qb_pfr_advstats_season.Rd b/man/get_qb_pfr_advstats_season.Rd index ee01a8c..71a514f 100644 --- a/man/get_qb_pfr_advstats_season.Rd +++ b/man/get_qb_pfr_advstats_season.Rd @@ -3,37 +3,9 @@ \name{get_qb_pfr_advstats_season} \alias{get_qb_pfr_advstats_season} \title{QB Advanced Season Stats from Pro Football Reference (PFR)} -\usage{ -get_qb_pfr_advstats_season(seasons = NULL) -} -\arguments{ -\item{seasons}{NFL Season(s) where \code{seasons = 2024}} -} -\value{ -Dataframe with QB advanced stats from Pro Football Reference (PFR) -for a defined season -} -\description{ -Obtain QB advanced season stats from \code{nflreadr}, -to acquire Pro Football Reference (PFR) data. -} -\details{ -\code{get_qb_pfr_advstats_season} is a function to obtain advanced stats from -Pro Football Reference (PFR). -The function utilizes the \code{nflreadr} function \code{load_pfr_advstats} to load -player level season stats starting with the 2018 season. -For quarterbacks, the \code{stat_type} is defined as \code{pass}. -More information is available about QB PFR advanced stats from -\href{https://nflreadr.nflverse.com/articles/dictionary_pfr_passing.html}{PFR passing data dictionary}. -} -\seealso{ -\code{\link[nflreadr]{load_pfr_advstats}} -Load advanced stats from PFR -} -\author{ -Nolan MacDonald - -\itemize{ +\format{ +A data frame with 26 variables that are described below. +\describe{ \item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} \item{\code{pass_attempts}}{Total pass attempts} \item{\code{throwaways}}{Number of throwaways} @@ -64,3 +36,33 @@ Pro Football Reference player ID (e.g., JackLa00) } } } +\usage{ +get_qb_pfr_advstats_season(seasons = NULL) +} +\arguments{ +\item{seasons}{NFL Season(s) where \code{seasons = 2024}} +} +\value{ +Dataframe with QB advanced stats from Pro Football Reference (PFR) +for a defined season +} +\description{ +Obtain QB advanced season stats from \code{nflreadr}, +to acquire Pro Football Reference (PFR) data. +} +\details{ +\code{get_qb_pfr_advstats_season} is a function to obtain advanced stats from +Pro Football Reference (PFR). +The function utilizes the \code{nflreadr} function \code{load_pfr_advstats} to load +player level season stats starting with the 2018 season. +For quarterbacks, the \code{stat_type} is defined as \code{pass}. +More information is available about QB PFR advanced stats from +\href{https://nflreadr.nflverse.com/articles/dictionary_pfr_passing.html}{PFR passing data dictionary}. +} +\seealso{ +\code{\link[nflreadr]{load_pfr_advstats}} +Load advanced stats from PFR +} +\author{ +Nolan MacDonald +} diff --git a/man/get_rb_combined_stats_season.Rd b/man/get_rb_combined_stats_season.Rd new file mode 100644 index 0000000..c3b3c6b --- /dev/null +++ b/man/get_rb_combined_stats_season.Rd @@ -0,0 +1,204 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_combined_stats_season.R +\name{get_rb_combined_stats_season} +\alias{get_rb_combined_stats_season} +\title{RB Cumulative Season Advanced Stats} +\format{ +A data frame with 57 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +\item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +\item{\code{pos}}{Player position (e.g., QB)} +\item{\code{tm}}{Player team (e.g., BAL)} +\item{\code{g}}{Number of games played} +\item{\code{carries}}{ +Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data +} +\item{\code{rushing_yards}}{ +Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data +} +\item{\code{rushing_tds}}{ +The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data +} +\item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +\item{\code{rushing_fumbles_lost}}{ +Number of rushes with a lost fumble from PBP data +} +\item{\code{rushing_first_downs}}{ +Number of rushing first downs from PBP data +} +\item{\code{rushing_epa}}{ +Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data +} +\item{\code{rushing_2pt_conversions}}{ +Two-point conversion rushes from PBP data +} +\item{\code{efficiency}}{Average efficiency (EFF) from NGS} +\item{\code{percent_attempts_gte_eight_defenders }}{ +Average percent attempts with 8+ Defenders in the Box (8+D) from NGS +} +\item{\code{avg_time_to_los}}{ +Average time behind line of scrimmage (TLOS) from NGS +} +\item{\code{avg_rush_yards}}{Average rush yards per attempt} +\item{\code{expected_rush_yards}}{Average expected rush yards from NGS} +\item{\code{rush_yards_over_expected}}{ +Average rush yards over expected from NGS +} +\item{\code{rush_yards_over_expected_per_att}}{ +Average rush yards over expected per attempt from NGS +} +\item{\code{rush_pct_over_expected}}{ +Average rush percent over expected from NGS +} +\item{\code{ybc}}{Rushing yards before contact from PFR} +\item{\code{ybc_att}}{ +Rushing yards before contact per rushing attempt from PFR +} +\item{\code{yac}}{Rushing yards after contact from PFR} +\item{\code{yac_att}}{Rushing yards after contact per attempt from PFR} +\item{\code{brk_tkl}}{Broken tackles on rushes from PFR} +\item{\code{att_br}}{Rush attempts per broken tackle from PFR} +\item{\code{fpts_std_4pt_td}}{ +Fantasy points for standard format with 4 point TD +} +\item{\code{ppg_std_4pt_td}}{ +Fantasy points per game for standard format with 4 point TD +} +\item{\code{fpts_half_ppr_4pt_td}}{ +Fantasy points for half PPR format with 4 point TD +} +\item{\code{ppg_half_ppr_4pt_td}}{ +Fantasy points per game for half PPR format with 4 point TD +} +\item{\code{fpts_ppr_4pt_td}}{ +Fantasy points for full PPR format with 4 point TD +} +\item{\code{ppg_ppr_4pt_td}}{ +Fantasy points per game for full PPR format with 4 point TD +} +\item{\code{fpts_std_6pt_td}}{ +Fantasy points for standard format with 6 point TD +} +\item{\code{ppg_std_6pt_td}}{ +Fantasy points per game for standard format with 6 point TD +} +\item{\code{fpts_half_ppr_6pt_td}}{ +Fantasy points for half PPR format with 6 point TD +} +\item{\code{ppg_half_ppr_6pt_td}}{ +Fantasy points per game for half PPR format with 6 point TD +} +\item{\code{fpts_ppr_6pt_td}}{ +Fantasy points for full PPR format with 6 point TD +} +\item{\code{ppg_ppr_6pt_td}}{ +Fantasy points per game for full PPR format with 6 point TD +} +\item{\code{tgt}}{ +Number of pass plays where the player was targeted as a receiver from +PBP data +} +\item{\code{rec}}{ +Number of pass receptions. Lateral receptions don't count as a reception +from PBP data +} +\item{\code{rec_yds}}{ +Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play from PBP data +} +\item{\code{rec_td}}{ +Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play from PBP data +} +\item{\code{receiving_fumbles}}{Number of fumbles after a pass reception +from PBP data +} +\item{\code{receiving_fumbles_lost}}{ +Number of fumbles lost after a pass reception from PBP data +} +\item{\code{receiving_air}}{ +Receiving air yards including incomplete passes from PBP data +} +\item{\code{yac_rec}}{ +Yards after the catch gained on plays in which player was receiver (this +is an unofficial stat and may differ slightly between different sources) +from PBP data +} +\item{\code{x1d_rec}}{ +Number of first downs gained on a reception from PBP data +} +\item{\code{receiving_epa}}{Expected points added on receptions +from PBP data +} +\item{\code{pfr_id}}{ +Pro Football Reference player ID (e.g., JackLa00) +} +} +} +\usage{ +get_rb_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +} +\description{ +Obtain RB stats from NFL cumulative season stats for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR). +} +\details{ +The function \code{get_rb_combined_stats_season} can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +\code{nflreadr} function \code{load_nextgen_stats} to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, \code{seasons} must be 2018 or later. +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database + +\code{\link[nflreadr]{load_nextgen_stats}} +Load player level weekly NFL Next Gen Stats + +\code{\link[nflreadr]{load_pfr_advstats}} +Load advanced stats from PFR +} +\author{ +Nolan MacDonald +} diff --git a/man/get_rb_ngs_advstats_season.Rd b/man/get_rb_ngs_advstats_season.Rd index 4dfc889..fe49dae 100644 --- a/man/get_rb_ngs_advstats_season.Rd +++ b/man/get_rb_ngs_advstats_season.Rd @@ -3,6 +3,30 @@ \name{get_rb_ngs_advstats_season} \alias{get_rb_ngs_advstats_season} \title{RB Cumulative Season NFL Next Gen Stats (NGS)} +\format{ +A data frame with 15 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} +\item{\code{player_display_name}}{Player name (e.g., Breece Hall)} +\item{\code{player_name}}{Player shortened name (e.g., B.Hall)} +\item{\code{position}}{Player position} +\item{\code{rush_attempts}}{Total rush attempts} +\item{\code{rush_yards}}{Total rush yards} +\item{\code{avg_rush_yards}}{Average rush yards per attempt} +\item{\code{rush_touchdowns}}{Total rush touchdowns} +\item{\code{efficiency}}{Average efficiency (EFF)} +\item{\code{percent_attempts_gte_eight_defenders }}{ +Average \% attempts with 8+ Defenders in the Box (8+D\%) +} +\item{\code{avg_time_to_los}}{Average time behind line of scrimmage (TLOS)} +\item{\code{expected_rush_yards}}{Average expected rush yards} +\item{\code{rush_yards_over_expected}}{Average rush yards over expected} +\item{\code{rush_yards_over_expected_per_att}}{ +Average rush yards over expected per attempt +} +\item{\code{rush_pct_over_expected}}{Average rush \% over expected} +} +} \usage{ get_rb_ngs_advstats_season(seasons = NULL) } @@ -34,26 +58,4 @@ Load player level weekly NFL Next Gen Stats } \author{ Nolan MacDonald - -\itemize{ -\item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} -\item{\code{player_display_name}}{Player name (e.g., Breece Hall)} -\item{\code{player_name}}{Player shortened name (e.g., B.Hall)} -\item{\code{position}}{Player position} -\item{\code{rush_attempts}}{Total rush attempts} -\item{\code{rush_yards}}{Total rush yards} -\item{\code{avg_rush_yards}}{Average rush yards per attempt} -\item{\code{rush_touchdowns}}{Total rush touchdowns} -\item{\code{efficiency}}{Average efficiency (EFF)} -\item{\code{percent_attempts_gte_eight_defenders }}{ -Average \% attempts with 8+ Defenders in the Box (8+D\%) -} -\item{\code{avg_time_to_los}}{Average time behind line of scrimmage (TLOS)} -\item{\code{expected_rush_yards}}{Average expected rush yards} -\item{\code{rush_yards_over_expected}}{Average rush yards over expected} -\item{\code{rush_yards_over_expected_per_att}}{ -Average rush yards over expected per attempt -} -\item{\code{rush_pct_over_expected}}{Average rush \% over expected} -} } diff --git a/man/get_rb_pbp_stats.Rd b/man/get_rb_pbp_stats.Rd index c708c84..ba0ad56 100644 --- a/man/get_rb_pbp_stats.Rd +++ b/man/get_rb_pbp_stats.Rd @@ -3,82 +3,9 @@ \name{get_rb_pbp_stats} \alias{get_rb_pbp_stats} \title{RB Stats from NFL Play-by-Play Data} -\usage{ -get_rb_pbp_stats( - pbp_db = NULL, - pbp_db_tbl = NULL, - season = NULL, - week_min = NULL, - week_max = NULL -) -} -\arguments{ -\item{pbp_db_tbl}{Play-by-Play database table name (optional)} - -\item{season}{NFL season (required) to obtain play-by-play data. The -season can be defined as a single season, \code{season = 2024}. For multiple -seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} - -\item{week_min}{Minimum week (required) to define whether pulling a range -of weeks or the entire season. Use \code{week_min = 1} for the first week of -the season, must be an integer.} - -\item{week_max}{Maximum week (optional) to define a range of weeks to pull -from an NFL season. If not defined, the data will be pulled for all weeks, -beginning with \code{week_min}.} - -\item{pbp_dp}{Play-by-Play database path (optional)} -} -\value{ -Dataframe with RB stats for user-defined season(s) and week(s) -obtained from NFL play-by-play data -} -\description{ -Obtain RB stats from NFL play-by-play data for a specified time frame -from either a saved database or \code{nflreadr::load_pbp()}. -} -\details{ -The function \code{get_rb_pbp_stats} can be utilized to obtain player stats -for a specified time frame that can include multiple seasons or even a -range of weeks instead of the entire season. -This includes stats for passing, rushing, and receiving obtained by using -the \code{nflfastR} function \code{calculate_player_stats()}. -The player stats are utilized to calculate fantasy points -based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). -The function acquires stats by using cumulative play-by-play data -by either loading from a saved database or using \code{nflreadr::load_pbp()}. -The data is obtained for a user-defined season or multiple seasons. -A range of weeks can also be defined with \code{week_min} and \code{week_max}. -If the entire season is desired, use \code{week_min = 1} and \code{week_max} does -not need to be defined. -To specify loading from a database, define the path to the database with -\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. -To load from a database, you will need to save play-by-play data to a -database using the \code{nflfastR} function, \code{update_db()}. -For example, the database is saved by default as \code{pbp_db} with a table that -is stored containing all play-by-play information called \code{nflfastR_pbp}. -Assume that the database is saved in \verb{project_name/data/}. -Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the -database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. -Note that these two arguments must be defined as strings. -For more information on calculated player stats, refer to the -\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} -} -\seealso{ -\code{\link[nuclearff]{nuclearff::get_pbp_data}} -Obtain play-by-play data for a specified time frame from either a saved -database or if not defined, using \code{nflreadr::load_pbp()}, - -\code{\link[nflreadr]{load_pbp}} -Load play-by-play data, - -\code{\link[nflfastR]{update_db}} -Update or Create a nflfastR Play-by-Play Database -} -\author{ -Nolan MacDonald - -\itemize{ +\format{ +A data frame with 59 variables that are described below. +\describe{ \item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} \item{\code{player_display_name}}{Player name (e.g., Breece Hall)} \item{\code{player_name}}{Player shortened name (e.g., B.Hall)} @@ -223,3 +150,78 @@ adjusted EPA/play in the following year } } } +\usage{ +get_rb_pbp_stats( + pbp_db = NULL, + pbp_db_tbl = NULL, + seasons = NULL, + week_min = NULL, + week_max = NULL +) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season(s) (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} + +\item{week_min}{Minimum week (required) to define whether pulling a range +of weeks or the entire season. Use \code{week_min = 1} for the first week of +the season, must be an integer.} + +\item{week_max}{Maximum week (optional) to define a range of weeks to pull +from an NFL season. If not defined, the data will be pulled for all weeks, +beginning with \code{week_min}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with RB stats for user-defined season(s) and week(s) +obtained from NFL play-by-play data +} +\description{ +Obtain RB stats from NFL play-by-play data for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. +} +\details{ +The function \code{get_rb_pbp_stats} can be utilized to obtain player stats +for a specified time frame that can include multiple seasons or even a +range of weeks instead of the entire season. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season or multiple seasons. +A range of weeks can also be defined with \code{week_min} and \code{week_max}. +If the entire season is desired, use \code{week_min = 1} and \code{week_max} does +not need to be defined. +To specify loading from a database, define the path to the database with +\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. +To load from a database, you will need to save play-by-play data to a +database using the \code{nflfastR} function, \code{update_db()}. +For example, the database is saved by default as \code{pbp_db} with a table that +is stored containing all play-by-play information called \code{nflfastR_pbp}. +Assume that the database is saved in \verb{project_name/data/}. +Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the +database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. +Note that these two arguments must be defined as strings. +For more information on calculated player stats, refer to the +\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database +} +\author{ +Nolan MacDonald +} diff --git a/man/get_rb_pfr_advstats_season.Rd b/man/get_rb_pfr_advstats_season.Rd index 6bd7c70..4898fa1 100644 --- a/man/get_rb_pfr_advstats_season.Rd +++ b/man/get_rb_pfr_advstats_season.Rd @@ -3,6 +3,29 @@ \name{get_rb_pfr_advstats_season} \alias{get_rb_pfr_advstats_season} \title{RB Advanced Season Stats from Pro Football Reference (PFR)} +\format{ +A data frame with 16 variables that are described below. +\describe{ +\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +\item{\code{age}}{} +\item{\code{position}}{} +\item{\code{g}}{Number of games played} +\item{\code{gs}}{Number of games started} +\item{\code{att}}{Total rush attempts} +\item{\code{yds}}{Total rush yards} +\item{\code{td}}{Total rush touchdowns} +\item{\code{x1d}}{Rushing first downs} +\item{\code{ybc}}{Rushing yards before contact} +\item{\code{ybc_att}}{Rushing yards before contact per rushing attempt} +\item{\code{yac}}{Rushing yards after contact} +\item{\code{yac_att}}{Rushing yards after contact per attempt} +\item{\code{brk_tkl}}{Broken tackles on rushes} +\item{\code{att_br}}{Rush attempts per broken tackle} +\item{\code{pfr_player_id}}{ +Pro Football Reference player ID (e.g., JackLa00) +} +} +} \usage{ get_rb_pfr_advstats_season(seasons = NULL) } @@ -33,25 +56,4 @@ Load advanced stats from PFR } \author{ Nolan MacDonald - -\itemize{ -\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} -\item{\code{age}}{} -\item{\code{position}}{} -\item{\code{g}}{Number of games played} -\item{\code{gs}}{Number of games started} -\item{\code{att}}{Total rush attempts} -\item{\code{yds}}{Total rush yards} -\item{\code{td}}{Total rush touchdowns} -\item{\code{x1d}}{Rushing first downs} -\item{\code{ybc}}{Rushing yards before contact} -\item{\code{ybc_att}}{Rushing yards before contact per rushing attempt} -\item{\code{yac}}{Rushing yards after contact} -\item{\code{yac_att}}{Rushing yards after contact per attempt} -\item{\code{brk_tkl}}{Broken tackles on rushes} -\item{\code{att_br}}{Rush attempts per broken tackle} -\item{\code{pfr_player_id}}{ -Pro Football Reference player ID (e.g., JackLa00) -} -} } diff --git a/man/get_te_combined_stats_season.Rd b/man/get_te_combined_stats_season.Rd new file mode 100644 index 0000000..798aeb6 --- /dev/null +++ b/man/get_te_combined_stats_season.Rd @@ -0,0 +1,220 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_combined_stats_season.R +\name{get_te_combined_stats_season} +\alias{get_te_combined_stats_season} +\title{TE Cumulative Season Advanced Stats} +\format{ +A data frame with 61 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +\item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +\item{\code{pos}}{Player position (e.g., QB)} +\item{\code{tm}}{Player team (e.g., BAL)} +\item{\code{g}}{Number of games played} +\item{\code{tgt}}{ +Number of pass plays where the player was targeted as a receiver from +PBP data +} +\item{\code{rec}}{ +Number of pass receptions. Lateral receptions don't count as a reception +from PBP data +} +\item{\code{rec_yds}}{ +Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play from PBP data +} +\item{\code{rec_td}}{ +Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play from PBP data +} +\item{\code{avg_yac}}{Average yards after catch (YAC) from NGS} +\item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC) from NGS} +\item{\code{avg_yac_above_expectation}}{ +Average yards after catch above expectation (+/-) from NGS +} +\item{\code{yac}}{Yards after catch (YAC) from PFR} +\item{\code{yac_r}}{Yards after catch (YAC) per reception from PFR} +\item{\code{adot}}{ +Average depth of target (ADOT) when targeted, whether completed or not, +from PFR +} +\item{\code{receiving_epa}}{Expected points added on receptions +from PBP data +} +\item{\code{racr}}{ +Receiving Air Conversion Ratio. +RACR = \code{receiving_yards} / \code{receiving_air_yards} from PBP +} +\item{\code{wopr}}{ +Weighted Opportunity Rating. +WOPR = 1.5 x \code{target_share} + 0.7 x \code{air_yards_share} from PBP data +} +\item{\code{avg_cushion}}{Average cushion (CUSH) from NGS} +\item{\code{avg_separation}}{Average separation (SEP) from NGS} +\item{\code{target_share}}{ +Share of targets of player compared to all team targets from PBP +} +\item{\code{tgt_pct}}{Share of targets percentage from PBP} +\item{\code{ybc}}{ +Total yards passes traveled in the air before being caught or yards +before catch (YBC) from PFR} +\item{\code{ybc_r}}{Yards before catch per reception from PFR} +\item{\code{receiving_air}}{ +Receiving air yards including incomplete passes from PBP data +} +\item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY) from NGS} +\item{\code{percent_share_of_intended_air_yards}}{ +Average \% share of team's air yards (TAY\%) from NGS +} +\item{\code{air_yards_share}}{ +Share of \code{receiving_air_yards} of the player to all team \code{air_yards} +from PBP data +} +\item{\code{x1d_rec}}{ +Number of first downs gained on a reception from PBP data +} +\item{\code{brk_tkl}}{Number of broken tackles from PFR} +\item{\code{rec_br}}{Receptions per broken tackle from PFR} +\item{\code{drop}}{Number of dropped passes from PFR} +\item{\code{drop_percent}}{Dropped pass percentage when targeted from PFR} +\item{\code{catch_percentage}}{Average catch percentage from NGS} +\item{\code{receiving_fumbles}}{Number of fumbles after a pass reception +from PBP data +} +\item{\code{receiving_fumbles_lost}}{ +Number of fumbles lost after a pass reception from PBP data +} +\item{\code{receiving_2pt_conversions}}{ +Two-point conversion receptions from PBP data +} +\item{\code{int_tgt}}{Interceptions on passes where targetedfrom PFR} +\item{\code{rat}}{Passer rating on passes when targeted from PFR} +\item{\code{fpts_std_4pt_td}}{ +Fantasy points for standard format with 4 point TD +} +\item{\code{ppg_std_4pt_td}}{ +Fantasy points per game for standard format with 4 point TD +} +\item{\code{fpts_half_ppr_4pt_td}}{ +Fantasy points for half PPR format with 4 point TD +} +\item{\code{ppg_half_ppr_4pt_td}}{ +Fantasy points per game for half PPR format with 4 point TD +} +\item{\code{fpts_ppr_4pt_td}}{ +Fantasy points for full PPR format with 4 point TD +} +\item{\code{ppg_ppr_4pt_td}}{ +Fantasy points per game for full PPR format with 4 point TD +} +\item{\code{fpts_std_6pt_td}}{ +Fantasy points for standard format with 6 point TD +} +\item{\code{ppg_std_6pt_td}}{ +Fantasy points per game for standard format with 6 point TD +} +\item{\code{fpts_half_ppr_6pt_td}}{ +Fantasy points for half PPR format with 6 point TD +} +\item{\code{ppg_half_ppr_6pt_td}}{ +Fantasy points per game for half PPR format with 6 point TD +} +\item{\code{fpts_ppr_6pt_td}}{ +Fantasy points for full PPR format with 6 point TD +} +\item{\code{ppg_ppr_6pt_td}}{ +Fantasy points per game for full PPR format with 6 point TD +} +\item{\code{carries}}{ +Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data +} +\item{\code{rushing_yards}}{ +Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data +} +\item{\code{rushing_tds}}{ +The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data +} +\item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +\item{\code{rushing_fumbles_lost}}{ +Number of rushes with a lost fumble from PBP data +} +\item{\code{rushing_first_downs}}{ +Number of rushing first downs from PBP data +} +\item{\code{rushing_epa}}{ +Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data +} +\item{\code{rushing_2pt_conversions}}{ +Two-point conversion rushes from PBP data +} +\item{\code{pfr_id}}{ +Pro Football Reference player ID (e.g., JackLa00) +} +} +} +\usage{ +get_te_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +} +\description{ +Obtain TE stats from NFL cumulative season stats for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR). +} +\details{ +The function \code{get_te_combined_stats_season} can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +\code{nflreadr} function \code{load_nextgen_stats} to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, \code{seasons} must be 2018 or later. +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database + +\code{\link[nflreadr]{load_nextgen_stats}} +Load player level weekly NFL Next Gen Stats + +\code{\link[nflreadr]{load_pfr_advstats}} +Load advanced stats from PFR +} +\author{ +Nolan MacDonald +} diff --git a/man/get_te_ngs_advstats_season.Rd b/man/get_te_ngs_advstats_season.Rd index 1d34e20..e4a9588 100644 --- a/man/get_te_ngs_advstats_season.Rd +++ b/man/get_te_ngs_advstats_season.Rd @@ -3,6 +3,31 @@ \name{get_te_ngs_advstats_season} \alias{get_te_ngs_advstats_season} \title{TE Cumulative Season NFL Next Gen Stats (NGS)} +\format{ +A data frame with 16 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0037744)} +\item{\code{player_display_name}}{Player name (e.g., Trey McBride)} +\item{\code{player_name}}{Player shortened name (e.g., T.McBride)} +\item{\code{position}}{Player position} +\item{\code{targets}}{Total receiving targets} +\item{\code{receptions}}{Total receptions} +\item{\code{yards}}{Total receiving yards} +\item{\code{rec_touchdowns}}{Total reception touchdowns} +\item{\code{avg_cushion}}{Average cushion (CUSH)} +\item{\code{avg_separation}}{Average separation (SEP)} +\item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY)} +\item{\code{avg_percent_share_of_intended_air_yards}}{ +Average \% share of team's air yards (TAY\%) +} +\item{\code{avg_catch_percentage}}{Average catch percentage} +\item{\code{avg_yac}}{Average yards after catch (YAC)} +\item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC)} +\item{\code{avg_yac_above_expectation}}{ +Average yards after catch above expectation (+/-) +} +} +} \usage{ get_te_ngs_advstats_season(seasons = NULL) } @@ -34,27 +59,4 @@ Load player level weekly NFL Next Gen Stats } \author{ Nolan MacDonald - -\itemize{ -\item{\code{player_id}}{Player gsis id (e.g., 00-0037744)} -\item{\code{player_display_name}}{Player name (e.g., Trey McBride)} -\item{\code{player_name}}{Player shortened name (e.g., T.McBride)} -\item{\code{position}}{Player position} -\item{\code{targets}}{Total receiving targets} -\item{\code{receptions}}{Total receptions} -\item{\code{yards}}{Total receiving yards} -\item{\code{rec_touchdowns}}{Total reception touchdowns} -\item{\code{avg_cushion}}{Average cushion (CUSH)} -\item{\code{avg_separation}}{Average separation (SEP)} -\item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY)} -\item{\code{avg_percent_share_of_intended_air_yards}}{ -Average \% share of team's air yards (TAY\%) -} -\item{\code{avg_catch_percentage}}{Average catch percentage} -\item{\code{avg_yac}}{Average yards after catch (YAC)} -\item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC)} -\item{\code{avg_yac_above_expectation}}{ -Average yards after catch above expectation (+/-) -} -} } diff --git a/man/get_te_pbp_stats.Rd b/man/get_te_pbp_stats.Rd index 1cff710..76f30ef 100644 --- a/man/get_te_pbp_stats.Rd +++ b/man/get_te_pbp_stats.Rd @@ -3,82 +3,9 @@ \name{get_te_pbp_stats} \alias{get_te_pbp_stats} \title{TE Stats from NFL Play-by-Play Data} -\usage{ -get_te_pbp_stats( - pbp_db = NULL, - pbp_db_tbl = NULL, - season = NULL, - week_min = NULL, - week_max = NULL -) -} -\arguments{ -\item{pbp_db_tbl}{Play-by-Play database table name (optional)} - -\item{season}{NFL season (required) to obtain play-by-play data. The -season can be defined as a single season, \code{season = 2024}. For multiple -seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} - -\item{week_min}{Minimum week (required) to define whether pulling a range -of weeks or the entire season. Use \code{week_min = 1} for the first week of -the season, must be an integer.} - -\item{week_max}{Maximum week (optional) to define a range of weeks to pull -from an NFL season. If not defined, the data will be pulled for all weeks, -beginning with \code{week_min}.} - -\item{pbp_dp}{Play-by-Play database path (optional)} -} -\value{ -Dataframe with TE stats for user-defined season(s) and week(s) -obtained from NFL play-by-play data -} -\description{ -Obtain TE stats from NFL play-by-play data for a specified time frame -from either a saved database or \code{nflreadr::load_pbp()}. -} -\details{ -The function \code{get_te_pbp_stats} can be utilized to obtain player stats -for a specified time frame that can include multiple seasons or even a -range of weeks instead of the entire season. -This includes stats for passing, rushing, and receiving obtained by using -the \code{nflfastR} function \code{calculate_player_stats()}. -The player stats are utilized to calculate fantasy points -based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). -The function acquires stats by using cumulative play-by-play data -by either loading from a saved database or using \code{nflreadr::load_pbp()}. -The data is obtained for a user-defined season or multiple seasons. -A range of weeks can also be defined with \code{week_min} and \code{week_max}. -If the entire season is desired, use \code{week_min = 1} and \code{week_max} does -not need to be defined. -To specify loading from a database, define the path to the database with -\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. -To load from a database, you will need to save play-by-play data to a -database using the \code{nflfastR} function, \code{update_db()}. -For example, the database is saved by default as \code{pbp_db} with a table that -is stored containing all play-by-play information called \code{nflfastR_pbp}. -Assume that the database is saved in \verb{project_name/data/}. -Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the -database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. -Note that these two arguments must be defined as strings. -For more information on calculated player stats, refer to the -\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} -} -\seealso{ -\code{\link[nuclearff]{nuclearff::get_pbp_data}}: -Obtain play-by-play data for a specified time frame from either a saved -database or if not defined, using \code{nflreadr::load_pbp()}, - -\code{\link[nflreadr]{load_pbp}} -Load play-by-play data, - -\code{\link[nflfastR]{update_db}} -Update or Create a nflfastR Play-by-Play Database -} -\author{ -Nolan MacDonald - -\itemize{ +\format{ +A data frame with 59 variables that are described below. +\describe{ \item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} \item{\code{player_display_name}}{Player name (e.g., Breece Hall)} \item{\code{player_name}}{Player shortened name (e.g., B.Hall)} @@ -223,3 +150,78 @@ adjusted EPA/play in the following year } } } +\usage{ +get_te_pbp_stats( + pbp_db = NULL, + pbp_db_tbl = NULL, + seasons = NULL, + week_min = NULL, + week_max = NULL +) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season(s) (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} + +\item{week_min}{Minimum week (required) to define whether pulling a range +of weeks or the entire season. Use \code{week_min = 1} for the first week of +the season, must be an integer.} + +\item{week_max}{Maximum week (optional) to define a range of weeks to pull +from an NFL season. If not defined, the data will be pulled for all weeks, +beginning with \code{week_min}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with TE stats for user-defined season(s) and week(s) +obtained from NFL play-by-play data +} +\description{ +Obtain TE stats from NFL play-by-play data for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. +} +\details{ +The function \code{get_te_pbp_stats} can be utilized to obtain player stats +for a specified time frame that can include multiple seasons or even a +range of weeks instead of the entire season. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season or multiple seasons. +A range of weeks can also be defined with \code{week_min} and \code{week_max}. +If the entire season is desired, use \code{week_min = 1} and \code{week_max} does +not need to be defined. +To specify loading from a database, define the path to the database with +\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. +To load from a database, you will need to save play-by-play data to a +database using the \code{nflfastR} function, \code{update_db()}. +For example, the database is saved by default as \code{pbp_db} with a table that +is stored containing all play-by-play information called \code{nflfastR_pbp}. +Assume that the database is saved in \verb{project_name/data/}. +Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the +database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. +Note that these two arguments must be defined as strings. +For more information on calculated player stats, refer to the +\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database +} +\author{ +Nolan MacDonald +} diff --git a/man/get_te_pfr_advstats_season.Rd b/man/get_te_pfr_advstats_season.Rd index f9043c2..f490340 100644 --- a/man/get_te_pfr_advstats_season.Rd +++ b/man/get_te_pfr_advstats_season.Rd @@ -3,6 +3,39 @@ \name{get_te_pfr_advstats_season} \alias{get_te_pfr_advstats_season} \title{TE Advanced Season Stats from Pro Football Reference (PFR)} +\format{ +A data frame with 22 variables that are described below. +\describe{ +\item{\code{player_display_name}}{Player name (e.g., George Kittle)} +\item{\code{age}}{Player age} +\item{\code{position}}{Player position} +\item{\code{g}}{Number of games played} +\item{\code{gs}}{Number of games started} +\item{\code{tgt}}{Total targets} +\item{\code{rec}}{Total receptions} +\item{\code{yds}}{Total receiving yards} +\item{\code{td}}{Total receiving touchdowns} +\item{\code{x1d}}{First downs receiving} +\item{\code{ybc}}{ +Total yards passes traveled in the air before being caught or yards +before catch (YBC)} +\item{\code{ybc_r}}{Yards before catch per reception} +\item{\code{yac}}{Yards after catch (YAC)} +\item{\code{yac_r}}{Yards after catch (YAC) per reception} +\item{\code{adot}}{ +Average depth of target (ADOT) when targeted, whether completed or not. +} +\item{\code{brk_tkl}}{Number of broken tackles} +\item{\code{rec_br}}{Receptions per broken tackle} +\item{\code{drop}}{Number of dropped passes} +\item{\code{drop_percent}}{Dropped pass percentage when targeted} +\item{\code{int_tgt}}{Interceptions on passes where targeted} +\item{\code{rat}}{Passer rating on passes when targeted} +\item{\code{pfr_player_id}}{ +Pro Football Reference player ID (e.g., KittGe00) +} +} +} \usage{ get_te_pfr_advstats_season(seasons = NULL) } @@ -33,35 +66,4 @@ Load advanced stats from PFR } \author{ Nolan MacDonald - -\itemize{ -\item{\code{player_display_name}}{Player name (e.g., George Kittle)} -\item{\code{age}}{Player age} -\item{\code{position}}{Player position} -\item{\code{g}}{Number of games played} -\item{\code{gs}}{Number of games started} -\item{\code{tgt}}{Total targets} -\item{\code{rec}}{Total receptions} -\item{\code{yds}}{Total receiving yards} -\item{\code{td}}{Total receiving touchdowns} -\item{\code{x1d}}{First downs receiving} -\item{\code{ybc}}{ -Total yards passes traveled in the air before being caught or yards -before catch (YBC)} -\item{\code{ybc_r}}{Yards before catch per reception} -\item{\code{yac}}{Yards after catch (YAC)} -\item{\code{yac_r}}{Yards after catch (YAC) per reception} -\item{\code{adot}}{ -Average depth of target (ADOT) when targeted, whether completed or not. -} -\item{\code{brk_tkl}}{Number of broken tackles} -\item{\code{rec_br}}{Receptions per broken tackle} -\item{\code{drop}}{Number of dropped passes} -\item{\code{drop_percent}}{Dropped pass percentage when targeted} -\item{\code{int_tgt}}{Interceptions on passes where targeted} -\item{\code{rat}}{Passer rating on passes when targeted} -\item{\code{pfr_player_id}}{ -Pro Football Reference player ID (e.g., KittGe00) -} -} } diff --git a/man/get_wr_combined_stats_season.Rd b/man/get_wr_combined_stats_season.Rd new file mode 100644 index 0000000..d261561 --- /dev/null +++ b/man/get_wr_combined_stats_season.Rd @@ -0,0 +1,220 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_combined_stats_season.R +\name{get_wr_combined_stats_season} +\alias{get_wr_combined_stats_season} +\title{WR Cumulative Season Advanced Stats} +\format{ +A data frame with 61 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0034796)} +\item{\code{player_display_name}}{Player name (e.g., Lamar Jackson)} +\item{\code{player_name}}{Player shortened name (e.g., L.Jackson)} +\item{\code{pos}}{Player position (e.g., QB)} +\item{\code{tm}}{Player team (e.g., BAL)} +\item{\code{g}}{Number of games played} +\item{\code{tgt}}{ +Number of pass plays where the player was targeted as a receiver from +PBP data +} +\item{\code{rec}}{ +Number of pass receptions. Lateral receptions don't count as a reception +from PBP data +} +\item{\code{rec_yds}}{ +Yards gained after a pass reception. Includes yards gained after +receiving a lateral on a play that started as a pass play from PBP data +} +\item{\code{rec_td}}{ +Number of reception touchdowns, including after receiving a lateral on a +play that began as a pass play from PBP data +} +\item{\code{avg_yac}}{Average yards after catch (YAC) from NGS} +\item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC) from NGS} +\item{\code{avg_yac_above_expectation}}{ +Average yards after catch above expectation (+/-) from NGS +} +\item{\code{yac}}{Yards after catch (YAC) from PFR} +\item{\code{yac_r}}{Yards after catch (YAC) per reception from PFR} +\item{\code{adot}}{ +Average depth of target (ADOT) when targeted, whether completed or not, +from PFR +} +\item{\code{receiving_epa}}{Expected points added on receptions +from PBP data +} +\item{\code{racr}}{ +Receiving Air Conversion Ratio. +RACR = \code{receiving_yards} / \code{receiving_air_yards} from PBP +} +\item{\code{wopr}}{ +Weighted Opportunity Rating. +WOPR = 1.5 x \code{target_share} + 0.7 x \code{air_yards_share} from PBP data +} +\item{\code{avg_cushion}}{Average cushion (CUSH) from NGS} +\item{\code{avg_separation}}{Average separation (SEP) from NGS} +\item{\code{target_share}}{ +Share of targets of player compared to all team targets from PBP +} +\item{\code{tgt_pct}}{Share of targets percentage from PBP} +\item{\code{ybc}}{ +Total yards passes traveled in the air before being caught or yards +before catch (YBC) from PFR} +\item{\code{ybc_r}}{Yards before catch per reception from PFR} +\item{\code{receiving_air}}{ +Receiving air yards including incomplete passes from PBP data +} +\item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY) from NGS} +\item{\code{percent_share_of_intended_air_yards}}{ +Average \% share of team's air yards (TAY\%) from NGS +} +\item{\code{air_yards_share}}{ +Share of \code{receiving_air_yards} of the player to all team \code{air_yards} +from PBP data +} +\item{\code{x1d_rec}}{ +Number of first downs gained on a reception from PBP data +} +\item{\code{brk_tkl}}{Number of broken tackles from PFR} +\item{\code{rec_br}}{Receptions per broken tackle from PFR} +\item{\code{drop}}{Number of dropped passes from PFR} +\item{\code{drop_percent}}{Dropped pass percentage when targeted from PFR} +\item{\code{catch_percentage}}{Average catch percentage from NGS} +\item{\code{receiving_fumbles}}{Number of fumbles after a pass reception +from PBP data +} +\item{\code{receiving_fumbles_lost}}{ +Number of fumbles lost after a pass reception from PBP data +} +\item{\code{receiving_2pt_conversions}}{ +Two-point conversion receptions from PBP data +} +\item{\code{int_tgt}}{Interceptions on passes where targetedfrom PFR} +\item{\code{rat}}{Passer rating on passes when targeted from PFR} +\item{\code{fpts_std_4pt_td}}{ +Fantasy points for standard format with 4 point TD +} +\item{\code{ppg_std_4pt_td}}{ +Fantasy points per game for standard format with 4 point TD +} +\item{\code{fpts_half_ppr_4pt_td}}{ +Fantasy points for half PPR format with 4 point TD +} +\item{\code{ppg_half_ppr_4pt_td}}{ +Fantasy points per game for half PPR format with 4 point TD +} +\item{\code{fpts_ppr_4pt_td}}{ +Fantasy points for full PPR format with 4 point TD +} +\item{\code{ppg_ppr_4pt_td}}{ +Fantasy points per game for full PPR format with 4 point TD +} +\item{\code{fpts_std_6pt_td}}{ +Fantasy points for standard format with 6 point TD +} +\item{\code{ppg_std_6pt_td}}{ +Fantasy points per game for standard format with 6 point TD +} +\item{\code{fpts_half_ppr_6pt_td}}{ +Fantasy points for half PPR format with 6 point TD +} +\item{\code{ppg_half_ppr_6pt_td}}{ +Fantasy points per game for half PPR format with 6 point TD +} +\item{\code{fpts_ppr_6pt_td}}{ +Fantasy points for full PPR format with 6 point TD +} +\item{\code{ppg_ppr_6pt_td}}{ +Fantasy points per game for full PPR format with 6 point TD +} +\item{\code{carries}}{ +Number of rush attempts including scrambles and kneel downs. Rushes after +a lateral reception don't count as a carry from PBP data +} +\item{\code{rushing_yards}}{ +Yards gained when rushing including scrambles and kneel downs. Also +includes yards gained after obtaining a lateral on a play that started +with a rushing attempt from PBP data +} +\item{\code{rushing_tds}}{ +The number of rushing touchdowns (incl. scrambles). Also includes +touchdowns after obtaining a lateral on a play that started with a +rushing attempt from PBP data +} +\item{\code{rushing_fumbles}}{Number of rushes with a fumble from PBP data} +\item{\code{rushing_fumbles_lost}}{ +Number of rushes with a lost fumble from PBP data +} +\item{\code{rushing_first_downs}}{ +Number of rushing first downs from PBP data +} +\item{\code{rushing_epa}}{ +Expected points added (EPA) on rush attempts including scrambles and +kneel downs from PBP data +} +\item{\code{rushing_2pt_conversions}}{ +Two-point conversion rushes from PBP data +} +\item{\code{pfr_id}}{ +Pro Football Reference player ID (e.g., JackLa00) +} +} +} +\usage{ +get_wr_combined_stats_season(pbp_db = NULL, pbp_db_tbl = NULL, seasons = NULL) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)} or \code{season = 2022:2024}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with QB stats for user-defined season(s) obtained from NFL +play-by-play data, Next Gen Stats (NGS) and Pro Football Reference (PFR) +} +\description{ +Obtain WR stats from NFL cumulative season stats for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. The stats are +obtained using play-by-play data, NFL Next Gen Stats (NGS) and Pro Football +Reference (PFR). +} +\details{ +The function \code{get_wr_combined_stats_season} can be utilized to obtain +player stats for a season, including advanced stats. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season. +Play-by-play data is merged with NFL Next Gen Stats (NGS) utilizing the +\code{nflreadr} function \code{load_nextgen_stats} to load player level weekly stats +starting with the 2016 season. +Play-by-play data is also merged with advanced stats from +Pro Football Reference (PFR), beginning from 2018. +Note that to use this function, \code{seasons} must be 2018 or later. +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database + +\code{\link[nflreadr]{load_nextgen_stats}} +Load player level weekly NFL Next Gen Stats + +\code{\link[nflreadr]{load_pfr_advstats}} +Load advanced stats from PFR +} +\author{ +Nolan MacDonald +} diff --git a/man/get_wr_ngs_advstats_season.Rd b/man/get_wr_ngs_advstats_season.Rd index 700b29c..50b1d15 100644 --- a/man/get_wr_ngs_advstats_season.Rd +++ b/man/get_wr_ngs_advstats_season.Rd @@ -3,6 +3,31 @@ \name{get_wr_ngs_advstats_season} \alias{get_wr_ngs_advstats_season} \title{WR Cumulative Season NFL Next Gen Stats (NGS)} +\format{ +A data frame with 16 variables that are described below. +\describe{ +\item{\code{player_id}}{Player gsis id (e.g., 00-0039337)} +\item{\code{player_display_name}}{Player name (e.g., Malik Nabers)} +\item{\code{player_name}}{Player shortened name (e.g., M.Nabers)} +\item{\code{position}}{Player position} +\item{\code{targets}}{Total receiving targets} +\item{\code{receptions}}{Total receptions} +\item{\code{yards}}{Total receiving yards} +\item{\code{rec_touchdowns}}{Total reception touchdowns} +\item{\code{avg_cushion}}{Average cushion (CUSH)} +\item{\code{avg_separation}}{Average separation (SEP)} +\item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY)} +\item{\code{percent_share_of_intended_air_yards}}{ +Average \% share of team's air yards (TAY\%) +} +\item{\code{catch_percentage}}{Average catch percentage} +\item{\code{avg_yac}}{Average yards after catch (YAC)} +\item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC)} +\item{\code{avg_yac_above_expectation}}{ +Average yards after catch above expectation (+/-) +} +} +} \usage{ get_wr_ngs_advstats_season(seasons = NULL) } @@ -34,27 +59,4 @@ Load player level weekly NFL Next Gen Stats } \author{ Nolan MacDonald - -\itemize{ -\item{\code{player_id}}{Player gsis id (e.g., 00-0039337)} -\item{\code{player_display_name}}{Player name (e.g., Malik Nabers)} -\item{\code{player_name}}{Player shortened name (e.g., M.Nabers)} -\item{\code{position}}{Player position} -\item{\code{targets}}{Total receiving targets} -\item{\code{receptions}}{Total receptions} -\item{\code{yards}}{Total receiving yards} -\item{\code{rec_touchdowns}}{Total reception touchdowns} -\item{\code{avg_cushion}}{Average cushion (CUSH)} -\item{\code{avg_separation}}{Average separation (SEP)} -\item{\code{avg_intended_air_yards}}{Average targeted air yards (TAY)} -\item{\code{avg_percent_share_of_intended_air_yards}}{ -Average \% share of team's air yards (TAY\%) -} -\item{\code{avg_catch_percentage}}{Average catch percentage} -\item{\code{avg_yac}}{Average yards after catch (YAC)} -\item{\code{avg_expected_yac}}{Average expected yards after catch (xYAC)} -\item{\code{avg_yac_above_expectation}}{ -Average yards after catch above expectation (+/-) -} -} } diff --git a/man/get_wr_pbp_stats.Rd b/man/get_wr_pbp_stats.Rd index ff10ef1..495f5eb 100644 --- a/man/get_wr_pbp_stats.Rd +++ b/man/get_wr_pbp_stats.Rd @@ -3,76 +3,9 @@ \name{get_wr_pbp_stats} \alias{get_wr_pbp_stats} \title{WR Stats from NFL Play-by-Play Data} -\usage{ -get_wr_pbp_stats( - pbp_db = NULL, - pbp_db_tbl = NULL, - season = NULL, - week_min = NULL, - week_max = NULL -) -} -\arguments{ -\item{pbp_db_tbl}{Play-by-Play database table name (optional)} - -\item{season}{NFL season (required) to obtain play-by-play data. The -season can be defined as a single season, \code{season = 2024}. For multiple -seasons, use either \code{season = c(2023,2024)}} - -\item{week_min}{Minimum week (required) to define whether pulling a range -of weeks or the entire season. Use \code{week_min = 1} for the first week of -the season, must be an integer.} - -\item{week_max}{Maximum week (optional) to define a range of weeks to pull -from an NFL season. If not defined, the data will be pulled for all weeks, -beginning with \code{week_min}.} - -\item{pbp_dp}{Play-by-Play database path (optional)} -} -\value{ -Dataframe with WR stats for user-defined season(s) and week(s) -obtained from NFL play-by-play data -} -\description{ -Obtain WR stats from NFL play-by-play data for a specified time frame -from either a saved database or \code{nflreadr::load_pbp()}. -} -\details{ -The function \code{get_wr_pbp_stats} can be utilized to obtain player stats -for a specified time frame that can include multiple seasons or even a -range of weeks instead of the entire season. -This includes stats for passing, rushing, and receiving obtained by using -the \code{nflfastR} function \code{calculate_player_stats()}. -The player stats are utilized to calculate fantasy points -based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). -The function acquires stats by using cumulative play-by-play data -by either loading from a saved database or using \code{nflreadr::load_pbp()}. -The data is obtained for a user-defined season or multiple seasons. -A range of weeks can also be defined with \code{week_min} and \code{week_max}. -If the entire season is desired, use \code{week_min = 1} and \code{week_max} does -not need to be defined. -To specify loading from a database, define the path to the database with -\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. -To load from a database, you will need to save play-by-play data to a -database using the \code{nflfastR} function, \code{update_db()}. -For example, the database is saved by default as \code{pbp_db} with a table that -is stored containing all play-by-play information called \code{nflfastR_pbp}. -Assume that the database is saved in \verb{project_name/data/}. -Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the -database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. -Note that these two arguments must be defined as strings. -For more information on calculated player stats, refer to the -\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} -} -\seealso{ -\code{\link[nuclearff]{get_pbp_data}}, -\code{\link[nflreadr]{load_pbp}}, -\code{\link[nflfastR]{update_db}} -} -\author{ -Nolan MacDonald - -\itemize{ +\format{ +A data frame with 59 variables that are described below. +\describe{ \item{\code{player_id}}{Player gsis id (e.g., 00-0038120)} \item{\code{player_display_name}}{Player name (e.g., Breece Hall)} \item{\code{player_name}}{Player shortened name (e.g., B.Hall)} @@ -217,3 +150,78 @@ adjusted EPA/play in the following year } } } +\usage{ +get_wr_pbp_stats( + pbp_db = NULL, + pbp_db_tbl = NULL, + seasons = NULL, + week_min = NULL, + week_max = NULL +) +} +\arguments{ +\item{pbp_db_tbl}{Play-by-Play database table name (optional)} + +\item{seasons}{NFL season(s) (required) to obtain play-by-play data. The +season can be defined as a single season, \code{season = 2024}. For multiple +seasons, use either \code{season = c(2023,2024)}} + +\item{week_min}{Minimum week (required) to define whether pulling a range +of weeks or the entire season. Use \code{week_min = 1} for the first week of +the season, must be an integer.} + +\item{week_max}{Maximum week (optional) to define a range of weeks to pull +from an NFL season. If not defined, the data will be pulled for all weeks, +beginning with \code{week_min}.} + +\item{pbp_dp}{Play-by-Play database path (optional)} +} +\value{ +Dataframe with WR stats for user-defined season(s) and week(s) +obtained from NFL play-by-play data +} +\description{ +Obtain WR stats from NFL play-by-play data for a specified time frame +from either a saved database or \code{nflreadr::load_pbp()}. +} +\details{ +The function \code{get_wr_pbp_stats} can be utilized to obtain player stats +for a specified time frame that can include multiple seasons or even a +range of weeks instead of the entire season. +This includes stats for passing, rushing, and receiving obtained by using +the \code{nflfastR} function \code{calculate_player_stats()}. +The player stats are utilized to calculate fantasy points +based on common scoring formats (4/6 point TD, STD, Half PPR, Full PPR). +The function acquires stats by using cumulative play-by-play data +by either loading from a saved database or using \code{nflreadr::load_pbp()}. +The data is obtained for a user-defined season or multiple seasons. +A range of weeks can also be defined with \code{week_min} and \code{week_max}. +If the entire season is desired, use \code{week_min = 1} and \code{week_max} does +not need to be defined. +To specify loading from a database, define the path to the database with +\code{pbp_db} as well as the name of the table to load with \code{pbp_db_tbl}. +To load from a database, you will need to save play-by-play data to a +database using the \code{nflfastR} function, \code{update_db()}. +For example, the database is saved by default as \code{pbp_db} with a table that +is stored containing all play-by-play information called \code{nflfastR_pbp}. +Assume that the database is saved in \verb{project_name/data/}. +Using the default naming scheme, \code{nuclearff::get_pbp_data} can be defined using the +database with \code{pbp_db = "data/pbp_db"} and \code{pbp_db_tbl = "nflfastR_pbp"}. +Note that these two arguments must be defined as strings. +For more information on calculated player stats, refer to the +\href{https://www.nflfastr.com/reference/calculate_player_stats.html}{nflfastR \code{calculate_player_stats()}} +} +\seealso{ +\code{\link[nuclearff]{nuclearff::get_pbp_data}} +Obtain play-by-play data for a specified time frame from either a saved +database or if not defined, using \code{nflreadr::load_pbp()} + +\code{\link[nflreadr]{load_pbp}} +Load play-by-play data + +\code{\link[nflfastR]{update_db}} +Update or Create a nflfastR Play-by-Play Database +} +\author{ +Nolan MacDonald +} diff --git a/man/get_wr_pfr_advstats_season.Rd b/man/get_wr_pfr_advstats_season.Rd index 0591684..b3ac54b 100644 --- a/man/get_wr_pfr_advstats_season.Rd +++ b/man/get_wr_pfr_advstats_season.Rd @@ -3,6 +3,39 @@ \name{get_wr_pfr_advstats_season} \alias{get_wr_pfr_advstats_season} \title{WR Advanced Season Stats from Pro Football Reference (PFR)} +\format{ +A data frame with 22 variables that are described below. +\describe{ +\item{\code{player_display_name}}{Player name (e.g., Malik Nabers)} +\item{\code{age}}{Player age} +\item{\code{position}}{Player position} +\item{\code{g}}{Number of games played} +\item{\code{gs}}{Number of games started} +\item{\code{tgt}}{Total targets} +\item{\code{rec}}{Total receptions} +\item{\code{yds}}{Total receiving yards} +\item{\code{td}}{Total receiving touchdowns} +\item{\code{x1d}}{First downs receiving} +\item{\code{ybc}}{ +Total yards passes traveled in the air before being caught or yards +before catch (YBC)} +\item{\code{ybc_r}}{Yards before catch per reception} +\item{\code{yac}}{Yards after catch (YAC)} +\item{\code{yac_r}}{Yards after catch (YAC) per reception} +\item{\code{adot}}{ +Average depth of target (ADOT) when targeted, whether completed or not. +} +\item{\code{brk_tkl}}{Number of broken tackles} +\item{\code{rec_br}}{Receptions per broken tackle} +\item{\code{drop}}{Number of dropped passes} +\item{\code{drop_percent}}{Dropped pass percentage when targeted} +\item{\code{int_tgt}}{Interceptions on passes where targeted} +\item{\code{rat}}{Passer rating on passes when targeted} +\item{\code{pfr_player_id}}{ +Pro Football Reference player ID (e.g., NabeMa00) +} +} +} \usage{ get_wr_pfr_advstats_season(seasons = NULL) } @@ -33,35 +66,4 @@ Load advanced stats from PFR } \author{ Nolan MacDonald - -\itemize{ -\item{\code{player_display_name}}{Player name (e.g., Malik Nabers)} -\item{\code{age}}{Player age} -\item{\code{position}}{Player position} -\item{\code{g}}{Number of games played} -\item{\code{gs}}{Number of games started} -\item{\code{tgt}}{Total targets} -\item{\code{rec}}{Total receptions} -\item{\code{yds}}{Total receiving yards} -\item{\code{td}}{Total receiving touchdowns} -\item{\code{x1d}}{First downs receiving} -\item{\code{ybc}}{ -Total yards passes traveled in the air before being caught or yards -before catch (YBC)} -\item{\code{ybc_r}}{Yards before catch per reception} -\item{\code{yac}}{Yards after catch (YAC)} -\item{\code{yac_r}}{Yards after catch (YAC) per reception} -\item{\code{adot}}{ -Average depth of target (ADOT) when targeted, whether completed or not. -} -\item{\code{brk_tkl}}{Number of broken tackles} -\item{\code{rec_br}}{Receptions per broken tackle} -\item{\code{drop}}{Number of dropped passes} -\item{\code{drop_percent}}{Dropped pass percentage when targeted} -\item{\code{int_tgt}}{Interceptions on passes where targeted} -\item{\code{rat}}{Passer rating on passes when targeted} -\item{\code{pfr_player_id}}{ -Pro Football Reference player ID (e.g., NabeMa00) -} -} } diff --git a/man/replace_player_names.Rd b/man/replace_player_names.Rd index faaedbf..c704497 100644 --- a/man/replace_player_names.Rd +++ b/man/replace_player_names.Rd @@ -4,7 +4,7 @@ \alias{replace_player_names} \title{Helper - Cleanup Player Names} \usage{ -replace_player_names(df) +replace_player_names(df, player_col = "player") } \arguments{ \item{df}{Dataframe with player column to clean up names}