possessioninfo <- function(dataframe){
dataframe <- dataframe %>%
group_by(match_id, possession) %>%
mutate(StartOfPossession = min(ElapsedTime),
TimeInPoss = ElapsedTime - StartOfPossession,
TimeToPossEnd = max(ElapsedTime) - ElapsedTime) %>%
ungroup()
return(dataframe)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.