Skip to contents

Build columns that aggregate kicking stats at the game level.

Usage

calculate_player_stats_kicking(pbp, weekly = FALSE)

Arguments

pbp

A Data frame of NFL play-by-play data typically loaded with load_pbp() or build_nflfastR_pbp().

weekly

If TRUE, returns week-by-week stats, otherwise, stats for the entire data frame in argument pbp.

Value

a dataframe of kicking stats

See also

https://nflreadr.nflverse.com/reference/load_player_stats.html for the nflreadr function to download this from repo (stat_type = "kicking")

Examples

# \donttest{
try({# to avoid CRAN test problems
    pbp <- nflreadr::load_pbp(2021)
    weekly <- calculate_player_stats_kicking(pbp, weekly = TRUE)
    dplyr::glimpse(weekly)

    overall <- calculate_player_stats_kicking(pbp, weekly = FALSE)
    dplyr::glimpse(overall)
})
#> Rows: 561
#> Columns: 44
#> $ season              <int> 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 20…
#> $ week                <int> 1, 2, 3, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19…
#> $ season_type         <chr> "REG", "REG", "REG", "REG", "REG", "REG", "REG", "…
#> $ player_id           <chr> "00-0023252", "00-0023252", "00-0023252", "00-0023…
#> $ team                <chr> "SF", "SF", "SF", "SF", "SF", "SF", "SF", "SF", "S…
#> $ player_name         <chr> "R.Gould", "R.Gould", "R.Gould", "R.Gould", "R.Gou…
#> $ player_display_name <chr> "Robbie Gould", "Robbie Gould", "Robbie Gould", "R…
#> $ position            <chr> "K", "K", "K", "K", "K", "K", "K", "K", "K", "K", …
#> $ position_group      <chr> "SPEC", "SPEC", "SPEC", "SPEC", "SPEC", "SPEC", "S…
#> $ headshot_url        <chr> "https://static.www.nfl.com/image/private/f_auto,q…
#> $ fg_made             <int> 2, 1, NA, 1, 1, 3, 2, 1, 2, 1, 1, 3, 2, 3, 2, 1, 1…
#> $ fg_att              <dbl> 3, 1, 0, 1, 1, 3, 3, 1, 3, 1, 1, 3, 2, 3, 2, 1, 2,…
#> $ fg_missed           <int> 1, 0, NA, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1…
#> $ fg_blocked          <int> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_long             <dbl> 52, 46, NA, 26, 50, 48, 46, 50, 33, 30, 48, 37, 42…
#> $ fg_pct              <dbl> 0.667, 1.000, NA, 1.000, 1.000, 1.000, 0.667, 1.00…
#> $ fg_made_0_19        <int> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_made_20_29       <int> 0, 0, NA, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0…
#> $ fg_made_30_39       <int> 0, 0, NA, 0, 0, 0, 0, 0, 1, 1, 0, 2, 0, 0, 0, 1, 1…
#> $ fg_made_40_49       <int> 1, 1, NA, 0, 0, 2, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0…
#> $ fg_made_50_59       <int> 1, 0, NA, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0…
#> $ fg_made_60_         <int> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_missed_0_19      <int> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_missed_20_29     <int> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_missed_30_39     <int> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_missed_40_49     <int> 0, 0, NA, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1…
#> $ fg_missed_50_59     <int> 1, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_missed_60_       <int> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_made_list        <chr> "40;52", "46", NA, "26", "50", "20;48;45", "46;22"…
#> $ fg_missed_list      <chr> "52", NA, NA, NA, NA, NA, "42", NA, "47", NA, NA, …
#> $ fg_blocked_list     <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
#> $ fg_made_distance    <dbl> 92, 46, NA, 26, 50, 113, 68, 50, 57, 30, 48, 100, …
#> $ fg_missed_distance  <dbl> 52, 0, NA, 0, 0, 0, 42, 0, 47, 0, 0, 0, 0, 0, 0, 0…
#> $ fg_blocked_distance <dbl> 0, 0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ pat_made            <int> 5, 2, 4, 2, 4, 3, 4, 2, 2, 4, 2, 2, 3, 2, 1, 2, 5,…
#> $ pat_att             <dbl> 5, 2, 4, 2, 4, 3, 4, 3, 2, 4, 2, 2, 3, 2, 1, 2, 5,…
#> $ pat_missed          <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
#> $ pat_blocked         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
#> $ pat_pct             <dbl> 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 0…
#> $ gwfg_att            <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,…
#> $ gwfg_distance       <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 24…
#> $ gwfg_made           <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1,…
#> $ gwfg_missed         <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0,…
#> $ gwfg_blocked        <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0,…
#> Rows: 58
#> Columns: 42
#> $ player_id           <chr> "00-0023252", "00-0023853", "00-0025565", "00-0025…
#> $ team                <chr> "SF", "ARI", "NE", "GB", "NYG", "TB", "TEN", "BAL"…
#> $ player_name         <chr> "R.Gould", "M.Prater", "N.Folk", "M.Crosby", "G.Ga…
#> $ player_display_name <chr> "Robbie Gould", "Matt Prater", "Nick Folk", "Mason…
#> $ games               <int> 16, 18, 18, 18, 17, 19, 17, 17, 16, 17, 11, 6, 7, …
#> $ position            <chr> "K", "K", "K", "K", "K", "K", "K", "K", "K", "K", …
#> $ position_group      <chr> "SPEC", "SPEC", "SPEC", "SPEC", "SPEC", "SPEC", "S…
#> $ headshot_url        <chr> "https://static.www.nfl.com/image/private/f_auto,q…
#> $ fg_made             <int> 26, 31, 37, 26, 29, 28, 27, 35, 30, 26, 18, 12, 16…
#> $ fg_att              <dbl> 29, 38, 40, 36, 33, 34, 32, 37, 36, 31, 20, 14, 18…
#> $ fg_missed           <int> 3, 7, 3, 7, 4, 6, 5, 2, 6, 4, 2, 2, 2, NA, 4, 3, 6…
#> $ fg_blocked          <int> 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, NA, 0, 1, 0…
#> $ fg_long             <dbl> 53, 62, 53, 54, 55, 48, 51, 66, 56, 61, 50, 50, 42…
#> $ fg_pct              <dbl> 0.897, 0.816, 0.925, 0.722, 0.879, 0.824, 0.844, 0…
#> $ fg_made_0_19        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, NA, 0, 0, 0…
#> $ fg_made_20_29       <int> 7, 11, 9, 9, 5, 11, 5, 7, 5, 7, 5, 3, 4, NA, 9, 10…
#> $ fg_made_30_39       <int> 5, 9, 11, 10, 12, 9, 13, 9, 15, 6, 4, 2, 8, NA, 8,…
#> $ fg_made_40_49       <int> 9, 3, 12, 4, 5, 8, 8, 13, 7, 8, 7, 6, 4, NA, 11, 1…
#> $ fg_made_50_59       <int> 5, 7, 5, 3, 7, 0, 1, 5, 3, 4, 1, 1, 0, NA, 8, 0, 3…
#> $ fg_made_60_         <int> 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, NA, 0, 0, 0…
#> $ fg_missed_0_19      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NA, 0, 0, 0…
#> $ fg_missed_20_29     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NA, 0, 0, 0…
#> $ fg_missed_30_39     <int> 0, 2, 0, 2, 1, 1, 0, 0, 1, 0, 0, 0, 1, NA, 1, 0, 2…
#> $ fg_missed_40_49     <int> 2, 2, 0, 4, 0, 4, 5, 2, 2, 0, 0, 1, 0, NA, 2, 1, 2…
#> $ fg_missed_50_59     <int> 1, 1, 3, 1, 3, 1, 0, 0, 2, 4, 2, 1, 1, NA, 1, 1, 2…
#> $ fg_missed_60_       <int> 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, NA, 0, 1, 0…
#> $ fg_made_list        <chr> "40;52;46;26;50;20;48;45;46;22;50;33;24;30;48;37;2…
#> $ fg_missed_list      <chr> "52;42;47", "43;68;61;39;36;51;41", "56;54;53", "3…
#> $ fg_blocked_list     <chr> NA, NA, NA, "34;37;39", NA, NA, NA, NA, NA, "22", …
#> $ fg_made_distance    <dbl> 1003, 1158, 1399, 936, 1146, 931, 985, 1401, 1139,…
#> $ fg_missed_distance  <dbl> 141, 339, 163, 283, 196, 273, 226, 97, 287, 212, 1…
#> $ fg_blocked_distance <dbl> 0, 0, 0, 110, 0, 0, 0, 0, 0, 22, 0, 0, 0, NA, 0, 4…
#> $ pat_made            <int> 44, 47, 44, 50, 17, 63, 43, 32, 44, 33, 30, 10, 10…
#> $ pat_att             <dbl> 45, 49, 49, 52, 17, 66, 46, 32, 50, 34, 32, 12, 12…
#> $ pat_missed          <int> 1, 2, 4, 2, 0, 3, 3, 0, 6, 1, 2, 2, 2, 2, 2, 1, 3,…
#> $ pat_blocked         <int> 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
#> $ pat_pct             <dbl> 0.978, 0.959, 0.898, 0.962, 1.000, 0.955, 0.935, 1…
#> $ gwfg_att            <int> 2, 1, 2, 2, 2, 2, 3, 3, 1, 0, 1, 1, 0, 0, 3, 2, 0,…
#> $ gwfg_distance_list  <chr> "24;45", "27", "56;21", "51;49", "35;27", "36;48",…
#> $ gwfg_made           <int> 2, 1, 1, 2, 2, 2, 3, 3, 1, NA, 1, 1, NA, NA, 3, 1,…
#> $ gwfg_missed         <int> 0, 0, 1, 0, 0, 0, 0, 0, 0, NA, 0, 0, NA, NA, 0, 1,…
#> $ gwfg_blocked        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, NA, 0, 0, NA, NA, 0, 0,…
# }