% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Clean.R
\name{add_shift_times}
\alias{add_shift_times}
\title{Add on-ice shift times to a play-by-play}
\usage{
add_shift_times(play_by_play, shift_chart)
}
\arguments{
\item{play_by_play}{data.frame of play-by-play(s) using the current public schema returned by \code{\link[=gc_play_by_play]{gc_play_by_play()}}, \code{\link[=gc_play_by_plays]{gc_play_by_plays()}}, \code{\link[=wsc_play_by_play]{wsc_play_by_play()}}, or \code{\link[=wsc_play_by_plays]{wsc_play_by_plays()}}}

\item{shift_chart}{data.frame returned by \code{\link[=shift_chart]{shift_chart()}} or \code{\link[=shift_charts]{shift_charts()}}}
}
\value{
data.frame with one row per event (play) and added or updated scalar on-ice shift timing columns
}
\description{
\code{add_shift_times()} adds \code{SecondsRemainingInShift},
\code{SecondsElapsedInShift}, and \code{SecondsElapsedInPeriodSinceLastShift} columns
for the on-ice goalies and skaters already present in a public play-by-play.
It accepts either a single game play-by-play plus \code{\link[=shift_chart]{shift_chart()}} data or a
season aggregate plus \code{\link[=shift_charts]{shift_charts()}} data.
}
\examples{
\donttest{
  pbp <- gc_play_by_play(game = 2023030417)
  sc  <- shift_chart(game = 2023030417)
  pbp <- add_shift_times(pbp, sc)
}
}
