
Calculate shift times by exact situation code
Source:R/Clean.R
calculate_shift_times_by_situation.Rdcalculate_shift_times_by_situation() returns one row per player per period
and splits time on ice by the exact play-by-play situationCode in effect
during that player's shifts. This differs from shift_chart_summary(),
which reads the NHL HTML report's broad EV/PP/SH totals. Here, shift seconds
come from shift_chart() and strength state comes from gc_play_by_play().
When season is supplied, it overrides game and the function uses
gc_play_by_plays() with shift_charts() for the full season.
Details
In the play-by-play, the four situationCode digits mean away goalie count,
away skater count, home skater count, and home goalie count. In this output,
the four digits in each situation-specific column mean player-team goalie
count, player-team skater count, opponent skater count, and opponent goalie
count. For example, raw 1451 means home skaters are on a 5-on-4 power play;
those seconds are written to 1541TimeOnIce for home players and
1451TimeOnIce for away players.