parse.first.down = function(pbp, play) {
play$first.down = FALSE
first_regex = "(?<first>1st down|first down)"
if (grepl(first_regex, pbp, perl=TRUE, fixed=FALSE, ignore.case=TRUE)) {
play$first.down = TRUE
}
return(play)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.