get_teams | R Documentation |
Gets all teams in a given league / year
get_teams(league_id, date_code)
league_id |
Code for league, from sfscrape::get_leagues |
date_code |
Code for date, from sfscrape::get_game_codes |
df teams, with cols for "team_name", "team_id", "team_code", "date_code"
# returns teams from 13 (Premier League), for date 220006 (FIFA 22) sfscrape::get_teams(13, 220006) # returns teams in all premier league season, for all seasons available FIFA 07 onwards fifa_games <- sfscrape::get_game_codes() codes <- fifa_games$code names(codes) <- fifa_games$game all_teams <- purrr::map_dfr(codes, ~get_teams(13, .x), .id = "game")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.