Raw data pull
library(StatsBombR)
library(worldfootballR)
library(dplyr)
library(janitor)
library(tibble)
Raw data pull
library(StatsBombR)
library(worldfootballR)
library(dplyr)
library(janitor)
library(tibble)
library(httr)
library(tibble)
library(tidyr)
library(dplyr)
library(purrr)
library(janitor)
library(cli)
library(stringr)
season | week | user_name | opponent_user_name | user_score | opponent_score | result | |
---|---|---|---|---|---|---|---|
2018 | 1 | Juan Avalos | Manuel Espinosa | 137.84 | 86.26 | W | |
2018 | 1 | Manuel Espinosa | Juan Avalos | 86.26 | 137.84 | L | |
2018 | 1 | Enrique Rodriguez | Tracy Krohn | 123.14 | 121.78 | W | |
2018 | 1 | Steven Valencia | Juan Pineda | 134.54 | 86.2 | W | |
2018 | 1 | Andrew ElHabr | Andrew Lara | 106.26 | 102.06 | W | |
2018 | 1 | Drake Hernandez | Tony ElHabr | 131.04 | 123.42 | W | |
2018 | 1 | Tony ElHabr | Drake Hernandez | 123.42 | 131.04 | L | |
2018 | 1 | Andrew Lara | Andrew ElHabr | 102.06 | 106.26 | L | |
2018 | 1 | Tracy Krohn | Enrique Rodriguez | 121.78 | 123.14 | L |
This is my attempt to replicate the analysis by Laurie Shaw here.
Creating some fake data.
library(tibble)
library(purrr)
library(tidyr)
library(MASS)
library(ggplot2)
library(readr)
library(dplyr)
opta_club_rankings <- read_csv('https://github.com/tonyelhabr/club-rankings/releases/download/club-rankings/opta-club-rankings.csv')
opta_club_rankings |>
filter(updated_at == max(updated_at))
#> # A tibble: 3,000 × 7
#> rank team rating `ranking change 7 days` date updated_at id
#> <dbl> <chr> <dbl> <dbl> <date> <dttm> <chr>
library(worldfootballR)
library(dplyr)
library(stringr)
library(readr)
library(purrr)
library(janitor)
# https://fbref.com/en/matches/a6ff9cf9/Chelsea-Norwich-City-October-23-2021-Premier-League
library(httr)
library(tibble)
library(purrr)
library(readr)
library(dplyr)
Scraping a specific stat for this match. Inspiration here. You can get other player stats in a similar fashion.
library(httr)
library(tibble)
library(tidyr)
library(dplyr)
library(purrr)
library(janitor)
For example, this.
library(httr)
library(tibble)
library(tidyr)
library(dplyr)
suppressPackageStartupMessages({
library(worldfootballR)
library(dplyr)
library(lubridate)
})
## Need the very most recent version of the package for `load_fotmob_match_details()` to work.
packageVersion("worldfootballR")