R/map_game_to_team.R

Defines functions map_game_to_away_team map_game_to_home_team

Documented in map_game_to_away_team map_game_to_home_team

#' Map game to home team
#' @param x character string with home team - away team
#' @return character string with home team
map_game_to_home_team <- function(x) {
  
  kb.utils::remove_everything_after(pattern = "-", x = x) %>% trimws()
  
}

#' Map game to away team
#' @param x character string with home team - away team
#' @return character string with away team
map_game_to_away_team <- function(x) {
  
  kb.utils::remove_everything_before(pattern = "-", x = x) %>% trimws()
  
}
kristian-bak/betting documentation built on Oct. 24, 2022, 1:35 p.m.