R/any_goals_before_minute_x.R

Defines functions any_goals_before_minute_x

Documented in any_goals_before_minute_x

#' Any goals before minute x
#' @param goals numeric vector with goalscoring minutes
#' @param x integer specifying the minute of interest
#' @return logical, TRUE if any goals where scored before the given minute
#'
any_goals_before_minute_x <- function(goals, x) {

  (goals < x) %>%
    any()

}
kristian-bak/football documentation built on Oct. 8, 2022, 2:11 p.m.