The function tidy_skaters_stats() is meant to be a user-friendly way of getting the NHL year-by-year statistics of selected skaters.

tidy_skaters_stats(
  players_id,
  regular = TRUE,
  playoffs = TRUE,
  keep_id = FALSE,
  return_datatable = getOption("tidynhl.data.table", TRUE)
)

Arguments

players_id

Integer vector indicating the NHL ID of skaters for whom the statistics will be returned.

regular

(optional) Logical indicating if the regular season statistics should be returned. Default to TRUE.

playoffs

(optional) Logical indicating if the playoffs statistics should be returned. Default to TRUE.

keep_id

(optional) Logical indicating if the IDs of different dimensions should be returned. Default to FALSE.

return_datatable

(optional) Logical indicating whether or not a data.table should be returned. Default can be set globally with options("tidynhl.data.table").

Examples

# Allowing large outputs for the pkgdown website options(width = 1000L) # Get the NHL career statistics of Vincent Lecavalier tidy_skaters_stats(8467329L)
#> player_name season_years season_type team_abbreviation skater_games skater_goals skater_assists skater_points skater_plusminus skater_pim skater_toi skater_shifts skater_gwg skater_otg skater_shots skater_blocked skater_hits skater_ev_goals skater_ev_assists skater_ev_points skater_ev_toi skater_pp_goals skater_pp_assists skater_pp_points skater_pp_toi skater_pk_goals skater_pk_assists skater_pk_points skater_pk_toi #> 1: Vincent Lecavalier 1998-99 regular TBL 82 13 15 28 -19 23 1120.11667 1155 2 0 125 0 52 11 10 21 918.91667 2 4 6 189.733333 0 1 1 11.4666667 #> 2: Vincent Lecavalier 1999-00 regular TBL 80 25 42 67 -25 43 1544.11667 1668 3 0 166 0 116 19 20 39 1114.41667 6 22 28 417.566667 0 0 0 12.1333333 #> 3: Vincent Lecavalier 2000-01 regular TBL 68 23 28 51 -26 66 1356.13333 1436 3 0 165 0 72 16 18 34 946.13333 7 10 17 389.300000 0 0 0 20.7000000 #> 4: Vincent Lecavalier 2001-02 regular TBL 76 20 17 37 -18 61 1302.85000 1516 3 2 164 0 85 15 8 23 1052.18333 5 9 14 241.433333 0 0 0 9.2333333 #> 5: Vincent Lecavalier 2002-03 regular TBL 80 33 45 78 0 39 1543.25000 1843 3 0 274 13 43 20 32 52 1134.86667 11 13 24 327.400000 2 0 2 80.9833333 #> 6: Vincent Lecavalier 2002-03 playoffs TBL 11 3 3 6 -2 22 248.53333 325 1 1 32 0 8 2 1 3 199.43333 1 2 3 35.700000 0 0 0 13.4000000 #> 7: Vincent Lecavalier 2003-04 regular TBL 81 32 34 66 23 52 1462.85000 1858 6 0 242 0 48 25 25 50 1136.56667 5 9 14 282.466667 2 0 2 43.8166667 #> 8: Vincent Lecavalier 2003-04 playoffs TBL 23 9 7 16 -2 25 451.83333 626 0 0 76 0 33 7 4 11 366.68333 2 3 5 78.800000 0 0 0 6.3500000 #> 9: Vincent Lecavalier 2005-06 regular TBL 80 35 40 75 0 90 1610.11667 1881 7 1 309 33 78 20 20 40 1100.68333 13 19 32 414.483333 2 1 3 94.9500000 #> 10: Vincent Lecavalier 2005-06 playoffs TBL 5 1 3 4 0 7 111.43333 137 0 0 17 1 10 0 2 2 72.43333 1 1 2 28.783333 0 0 0 10.2166667 #> 11: Vincent Lecavalier 2006-07 regular TBL 82 52 56 108 2 44 1853.53333 2105 7 1 339 22 112 31 32 63 1340.31667 16 20 36 388.150000 5 4 9 125.0666667 #> 12: Vincent Lecavalier 2006-07 playoffs TBL 6 5 2 7 4 10 158.86667 183 1 0 30 1 21 4 1 5 112.26667 1 1 2 32.816667 0 0 0 13.7833333 #> 13: Vincent Lecavalier 2007-08 regular TBL 81 40 52 92 -17 89 1859.08333 2014 7 0 318 21 112 29 30 59 1394.66667 10 19 29 337.950000 1 3 4 126.4666667 #> 14: Vincent Lecavalier 2008-09 regular TBL 77 29 38 67 -9 54 1559.46667 1943 6 1 291 29 110 18 23 41 1120.43333 10 14 24 327.883333 1 1 2 111.1500000 #> 15: Vincent Lecavalier 2009-10 regular TBL 82 24 46 70 -16 63 1622.81667 2029 3 0 295 21 80 19 26 45 1234.46667 5 20 25 331.416667 0 0 0 56.9333333 #> 16: Vincent Lecavalier 2010-11 regular TBL 65 25 29 54 -5 43 1199.51667 1464 5 2 210 25 93 13 13 26 925.20000 12 16 28 259.266667 0 0 0 15.0500000 #> 17: Vincent Lecavalier 2010-11 playoffs TBL 18 6 13 19 6 16 357.50000 444 3 1 56 7 20 3 9 12 281.13333 3 4 7 72.350000 0 0 0 4.0166667 #> 18: Vincent Lecavalier 2011-12 regular TBL 64 22 27 49 -2 50 1211.60000 1407 5 1 182 31 103 17 21 38 982.26667 5 6 11 217.633333 0 0 0 11.7000000 #> 19: Vincent Lecavalier 2012-13 regular TBL 39 10 22 32 -5 29 697.43333 851 0 0 86 13 74 5 18 23 570.95000 5 4 9 119.200000 0 0 0 7.2833333 #> 20: Vincent Lecavalier 2013-14 regular PHI 69 20 17 37 -16 44 1048.16667 1389 3 1 132 19 77 12 12 24 876.33333 8 5 13 169.250000 0 0 0 2.5833333 #> 21: Vincent Lecavalier 2013-14 playoffs PHI 7 1 1 2 -5 2 74.80000 110 0 0 9 2 4 0 0 0 61.61667 1 1 2 13.183333 0 0 0 0.0000000 #> 22: Vincent Lecavalier 2014-15 regular PHI 57 8 12 20 -7 36 720.90000 983 0 0 103 15 40 7 9 16 610.73333 1 3 4 109.983333 0 0 0 0.1833333 #> 23: Vincent Lecavalier 2015-16 regular PHI 7 0 1 1 -1 2 66.21667 99 0 0 7 1 2 0 1 1 63.78333 0 0 0 2.433333 0 0 0 0.0000000 #> 24: Vincent Lecavalier 2015-16 regular LAK 42 10 7 17 1 20 582.55000 830 0 0 60 21 60 4 6 10 485.61667 6 1 7 73.266667 0 0 0 23.6666667 #> 25: Vincent Lecavalier 2015-16 playoffs LAK 5 1 1 2 0 2 71.66667 109 0 0 8 2 11 0 1 1 62.43333 1 0 1 7.950000 0 0 0 1.2833333 #> player_name season_years season_type team_abbreviation skater_games skater_goals skater_assists skater_points skater_plusminus skater_pim skater_toi skater_shifts skater_gwg skater_otg skater_shots skater_blocked skater_hits skater_ev_goals skater_ev_assists skater_ev_points skater_ev_toi skater_pp_goals skater_pp_assists skater_pp_points skater_pp_toi skater_pk_goals skater_pk_assists skater_pk_points skater_pk_toi
# Get the NHL career playoffs statistics of both Vincent Lecavalier and Martin St. Louis, keeping # the IDs tidy_skaters_stats(c(8467329L, 8466378L), regular = FALSE, keep_id = TRUE)
#> player_id player_name season_id season_years season_type team_id team_abbreviation skater_games skater_goals skater_assists skater_points skater_plusminus skater_pim skater_toi skater_shifts skater_gwg skater_otg skater_shots skater_blocked skater_hits skater_ev_goals skater_ev_assists skater_ev_points skater_ev_toi skater_pp_goals skater_pp_assists skater_pp_points skater_pp_toi skater_pk_goals skater_pk_assists skater_pk_points skater_pk_toi #> 1: 8466378 Martin St. Louis 20022003 2002-03 playoffs 14 TBL 11 7 5 12 5 0 245.80000 348 3 1 25 0 11 4 3 7 189.78333 1 2 3 29.35000 2 0 2 26.6666667 #> 2: 8466378 Martin St. Louis 20032004 2003-04 playoffs 14 TBL 23 9 15 24 6 14 525.98333 699 3 2 58 0 19 5 11 16 400.11667 3 4 7 86.81667 1 0 1 39.0500000 #> 3: 8466378 Martin St. Louis 20052006 2005-06 playoffs 14 TBL 5 4 0 4 -2 2 114.45000 143 1 0 15 0 4 3 0 3 74.36667 1 0 1 29.96667 0 0 0 10.1166667 #> 4: 8466378 Martin St. Louis 20062007 2006-07 playoffs 14 TBL 6 3 5 8 6 8 168.65000 183 0 0 17 3 8 2 4 6 123.96667 1 1 2 33.05000 0 0 0 11.6333333 #> 5: 8466378 Martin St. Louis 20102011 2010-11 playoffs 14 TBL 18 10 10 20 -8 4 381.38333 450 1 0 50 15 8 6 3 9 305.15000 4 7 11 73.93333 0 0 0 2.3000000 #> 6: 8466378 Martin St. Louis 20132014 2013-14 playoffs 3 NYR 25 8 7 15 -5 2 481.58333 679 3 1 55 22 10 6 3 9 357.15000 2 4 6 90.10000 0 0 0 34.3333333 #> 7: 8466378 Martin St. Louis 20142015 2014-15 playoffs 3 NYR 19 1 6 7 -1 4 313.50000 449 0 0 32 9 12 0 4 4 258.75000 1 2 3 54.21667 0 0 0 0.5333333 #> 8: 8467329 Vincent Lecavalier 20022003 2002-03 playoffs 14 TBL 11 3 3 6 -2 22 248.53333 325 1 1 32 0 8 2 1 3 199.43333 1 2 3 35.70000 0 0 0 13.4000000 #> 9: 8467329 Vincent Lecavalier 20032004 2003-04 playoffs 14 TBL 23 9 7 16 -2 25 451.83333 626 0 0 76 0 33 7 4 11 366.68333 2 3 5 78.80000 0 0 0 6.3500000 #> 10: 8467329 Vincent Lecavalier 20052006 2005-06 playoffs 14 TBL 5 1 3 4 0 7 111.43333 137 0 0 17 1 10 0 2 2 72.43333 1 1 2 28.78333 0 0 0 10.2166667 #> 11: 8467329 Vincent Lecavalier 20062007 2006-07 playoffs 14 TBL 6 5 2 7 4 10 158.86667 183 1 0 30 1 21 4 1 5 112.26667 1 1 2 32.81667 0 0 0 13.7833333 #> 12: 8467329 Vincent Lecavalier 20102011 2010-11 playoffs 14 TBL 18 6 13 19 6 16 357.50000 444 3 1 56 7 20 3 9 12 281.13333 3 4 7 72.35000 0 0 0 4.0166667 #> 13: 8467329 Vincent Lecavalier 20132014 2013-14 playoffs 4 PHI 7 1 1 2 -5 2 74.80000 110 0 0 9 2 4 0 0 0 61.61667 1 1 2 13.18333 0 0 0 0.0000000 #> 14: 8467329 Vincent Lecavalier 20152016 2015-16 playoffs 26 LAK 5 1 1 2 0 2 71.66667 109 0 0 8 2 11 0 1 1 62.43333 1 0 1 7.95000 0 0 0 1.2833333