# \donttest{
try({
library(dplyr)
library(tidyr)
# one league
fotmob_get_league_matches(
country = "ENG",
league_name = "Premier League"
)
# one league, by id
fotmob_get_league_matches(
league_id = 47
)
# multiple leagues (could also use ids)
league_matches <- fotmob_get_league_matches(
country = c("ENG", "ESP" ),
league_name = c("Premier League", "LaLiga")
)
# probably the data that you care about
league_matches %>%
dplyr::select(match_id = id, home, away) %>%
tidyr::unnest_wider(c(home, away), names_sep = "_")
})
# }
Run the code above in your browser using DataLab