| Title: | Analysis of Punting |
|---|---|
| Description: | A package for importing, manipulating, analyzing, and visualizing data related to football punting. Uses play-by-play dataframes in the format used by nflscrapR and nflfastR. |
| Authors: | Dennis Brookner [aut, cre], Raphael LadenGuindon [aut] |
| Maintainer: | Dennis Brookner <[email protected]> |
| License: | MIT |
| Version: | 1.4 |
| Built: | 2026-09-19 01:47:11 UTC |
| Source: | https://github.com/Puntalytics/puntr |
This function is essentially a convenient wrapper for dplyr::summarise
which includes all of the relevant columns from a puntr-style data frame.
This function differs from puntr::create_mini and puntr::create_miniY
in that it groups by punter_player_name, season, and week
(and adds a convenient weekid column to uniquely identify each row).
It is unfortunately not customizable beyond the setting of a minimum number of punts to be included;
if you have additional parameters you'd like to be summarised, the easiest thing would be to call summarise yourself.
by_punter_games(punts, ..., threshold = 1)by_punter_games(punts, ..., threshold = 1)
punts |
The play-by-play punting data to be summarized |
threshold |
The minimum number of punts for a week to be included, defaults to 1 |
A tibble miniG where each row is a punter-week and each column is a stat
## Not run: create_miniG(punts) ## End(Not run)## Not run: create_miniG(punts) ## End(Not run)
This function is essentially a convenient wrapper for dplyr::summarise
which includes all of the relevant columns from a puntr-style data frame.
This function differs from puntr::create_mini
in that it groups by both punter_player_name and season (and adds a convenient seasonid column to uniquely identify each row).
It is unfortunately not customizable beyond the setting of a minimum number of punts to be included;
if you have additional parameters you'd like to be summarised, the easiest thing would be to call summarise yourself.
by_punter_seasons(punts, ..., threshold = 32)by_punter_seasons(punts, ..., threshold = 32)
punts |
The play-by-play punting data to be summarized |
threshold |
The minimum number of punts for a season to be included, defaults to 32 |
A tibble miniY where each row is a punter-season and each column is a stat
## Not run: create_miniY(punts) ## End(Not run)## Not run: create_miniY(punts) ## End(Not run)
This function is essentially a convenient wrapper for dplyr::summarise
which provides a dataframe with the following columns: NumPunts, pEPA, Gross, Net, RERUN, SHARP_RERUN_OF, SHARP_RERUN_PD,
first_year, last_year, team_logo_espn, team_color, team_color2. Additional columns may be added via valid calls to dplyr::summarise
as additional arguments.
For comparison of punter seasons, see puntr::by_punter_seasons; for comparison of punter games, see puntr::by_punter_games.
by_punters(punts, ..., threshold = 64)by_punters(punts, ..., threshold = 64)
punts |
The play-by-play punting data to be summarized |
... |
Any additional arguments will be passed through to |
threshold |
The minimum number of career punts needed to be included, defaults to 64 |
A tibble punters where each row is a punter and each column is a stat
## Not run: create_mini(punts) ## End(Not run)## Not run: create_mini(punts) ## End(Not run)
This function adds all Puntalytics metrics to your punting data: RERUN, SHARP, SHARPnet and SHARP_RERUN (plus open-field and pin-deep versions of the 3 SHARPs) as well as average and cumulative EPA (our custom EPA metric.)
calculate_all(punts)calculate_all(punts)
punts |
The already-processed play-by-play punting data to which metrics will be added. Must contain at least three seasons and 1000 punts. |
A tibble punts with the calculated metrics added
## Not run: calculate_all(punts) ## End(Not run)## Not run: calculate_all(punts) ## End(Not run)
puntr formatRename columns and process data such that the output can be plugged directly into puntr::calculate_all,
and the output of that can be plugged directly into puntr::create_mini (or puntr::create_miniY).
college_to_pro(punts, power_five = TRUE)college_to_pro(punts, power_five = TRUE)
punts |
A data frame containing punts in the cfbfastR format |
power_five |
Logical, defaults to TRUE to include only punters from Power 5 teams |
A tibble punts in a format usable for puntr::calculate_all
## Not run: college_to_pro(punts) ## End(Not run)## Not run: college_to_pro(punts) ## End(Not run)
This function is essentially a convenient wrapper for dplyr::summarise
which includes all of the relevant columns from a puntr-style data frame.
NOTE: puntr::create_mini, puntr::create_miniY, and puntr::create_miniG are being phased out
in favor of puntr::by_punters, puntr::by_punter_seasons, and puntr::by_punter_games
create_mini(punts, ..., threshold = 64)create_mini(punts, ..., threshold = 64)
punts |
The play-by-play punting data to be summarized |
... |
Any additional arguments will be passed through to |
threshold |
The minimum number of career punts needed to be included, defaults to 64 |
A tibble mini where each row is a punter and each column is a stat
## Not run: create_mini(punts) ## End(Not run)## Not run: create_mini(punts) ## End(Not run)
This function is essentially a convenient wrapper for dplyr::summarise
which includes all of the relevant columns from a puntr-style data frame.
This function differs from puntr::create_mini and puntr::create_miniY
in that it groups by punter_player_name, season, and week
(and adds a convenient weekid column to uniquely identify each row).
NOTE: puntr::create_mini, puntr::create_miniY, and puntr::create_miniG are being phased out
in favor of puntr::by_punters, puntr::by_punter_seasons, and puntr::by_punter_games
create_miniG(punts, ..., threshold = 1)create_miniG(punts, ..., threshold = 1)
punts |
The play-by-play punting data to be summarized |
... |
Any additional arguments will be passed through to |
threshold |
The minimum number of punts for a week to be included, defaults to 1 |
A tibble miniG where each row is a punter-week and each column is a stat
## Not run: create_miniG(punts) ## End(Not run)## Not run: create_miniG(punts) ## End(Not run)
This function is essentially a convenient wrapper for dplyr::summarise
which includes all of the relevant columns from a puntr-style data frame.
This function differs from puntr::create_mini
in that it groups by both punter_player_name and season (and adds a convenient seasonid column to uniquely identify each row).
NOTE: puntr::create_mini, puntr::create_miniY, and puntr::create_miniG are being phased out
in favor of puntr::by_punters, puntr::by_punter_seasons, and puntr::by_punter_games
create_miniY(punts, ..., threshold = 32)create_miniY(punts, ..., threshold = 32)
punts |
The play-by-play punting data to be summarized |
... |
Any additional arguments will be passed through to |
threshold |
The minimum number of punts for a season to be included, defaults to 32 |
A tibble miniY where each row is a punter-season and each column is a stat
## Not run: create_miniY(punts) ## End(Not run)## Not run: create_miniY(punts) ## End(Not run)
Import college punting data for seasons in the scope of cfbfastR (back to 2014).
This function is a wrapper around cfbfastR::load_cfb_pbp.
import_college_punts(years)import_college_punts(years)
years |
A year or range of years to be scraped |
A tibble punts of punts in the cfbfastR format
## Not run: import_college_punts(2018:2021) ## End(Not run)## Not run: import_college_punts(2018:2021) ## End(Not run)
Easily import punting data for completed seasons.
This data has been pre-scraped and compiled here.
The only cleaning performed on this data before storing is filter(play_type == 'punt').
import_punts(years, local = FALSE, path = NULL)import_punts(years, local = FALSE, path = NULL)
years |
A year or range of years between 1999 and 2020, inclusive |
local |
Defaults to 'FALSE'. If 'TRUE', must also specify the local path to the 'puntr-data' folder. Importing a local copy of the data is much faster (~3 seconds, vs ~15 minutes) |
path |
The local path to the 'puntr-data' folder. Required when 'local = TRUE'. Omit the trailing '/', e.g. '/Users/yourname/footballfolder' |
A tibble punts containing play-by-play punting data for the specified years
## Not run: import_punts(1999:2020) import_punts(1999:2020, local=TRUE, path='/my/local/path') ## End(Not run)## Not run: import_punts(1999:2020) import_punts(1999:2020, local=TRUE, path='/my/local/path') ## End(Not run)
Grab all play-by-play data, not just punts. This function pulls data directly from the nflfastR-data repo, and
is purely a wrapper for ease of use.
import_seasons(years)import_seasons(years)
years |
A year or range of years between 1999 and 2020, inclusive |
A tibble pbp containing play-by-play data for the specified years
## Not run: import_seasons(1999:2019) ## End(Not run)## Not run: import_seasons(1999:2019) ## End(Not run)
This function is exported in case you would like include custom columns; if you would NOT, you can just
use [puntr::trust_the_process].
If you do use puntr::punt_trim yourself, be sure to include the trim=FALSE flag in puntr::trust_the_process.
punt_trim(punts, columns = NULL)punt_trim(punts, columns = NULL)
punts |
The play-by-play punting data |
columns |
Defaults to |
A tibble punts containing only the specified columns
## Not run: punt_trim(punts) punt_trim(punts, columns=c("solo_tackle", "assist_tackle")) ## End(Not run)## Not run: punt_trim(punts) punt_trim(punts, columns=c("solo_tackle", "assist_tackle")) ## End(Not run)
This function handles all of the standard data cleaning necessary/preferable for puntalytics.
trust_the_process(punts, seasontype = "REG", trim = TRUE)trust_the_process(punts, seasontype = "REG", trim = TRUE)
punts |
The play-by-play punting data to be cleaned and processed |
seasontype |
One of "REG" (default) or "POST" to filter data, or NULL to include all data |
trim |
Specify |
A tibble punts with cleaned and processed play-by-play punting data
## Not run: trust_the_process(punts) trust_the_process(punts_custom_trimmed_already, trim=FALSE) ## End(Not run)## Not run: trust_the_process(punts) trust_the_process(punts_custom_trimmed_already, trim=FALSE) ## End(Not run)