Overview

This package is designed to allow users to extract various world football results and player statistics data from fbref.com and valuations and transfer data from transfermarkt.com.

Installation

You can install the worldfootballR package from github with:

# install.packages("devtools")
devtools::install_github("JaseZiv/worldfootballR")

Usage

The functions available in this package are designed to enable the extraction of world football data.

There are four main categories of data extract functions in this package:

  • fbref helper functions to extract key URLs
  • Match-level statistics (team and player)
  • Season-level statistics (team and player)
  • Player market vluations and transfer histories

This vignette will cover the helper functions to extract important URLs from fbref.

League URLs

To extract the URL of any country’s league(s) (provided fbref have data for the league), use the fb_league_urls() function.

This function also accepts a tier argument. for first-tier leagues, select ‘1st’, for second-tier select ‘2nd’ and so on.

A fill list of countries available can be found in the worldfootballR_data repository and can be found here.

fb_league_urls(country = "ENG", gender = "M", season_end_year = 2021, tier = '2nd')

Team URLs

To get a list of URLs for each team in a particular season, the fb_teams_urls() function can be used:

fb_teams_urls("https://fbref.com/en/comps/9/Premier-League-Stats")

Player URLs

To get a list of player URLs for a particular team, the fb_player_urls() function can be used. The reuslts of this output can be passed through to the player season stat functions fb_player_season_stats() and fb_player_scouting_report().

fb_player_urls("https://fbref.com/en/squads/fd962109/Fulham-Stats")