Skip to contents

Gets league-play data for each game, from engsoccerdata, returning a tibble in a standardised format.

Usage

uss_get_matches(country = uss_countries(), ...)

Arguments

country

character scalar, specifies the league.

...

<data-masking> Expressions that return a logical value, and are defined in terms of the variables in .data. If multiple expressions are included, they are combined with the & operator. Only rows for which all conditions evaluate to TRUE are kept.

Value

a tibble with columns country, date, season, tier, home, visitor, goals_home, goals_visitor.

Details

uss_countries() returns the available choices; "england" is the default. Additional arguments are passed to dplyr::filter().

This function relies on an internal function, uss_make_matches(), to parse the source data.

Examples

uss_get_matches("england")
#> # A tibble: 192,004 × 8
#>    country  tier season date       home         visitor goals_home goals_visitor
#>    <chr>   <int>  <int> <date>     <chr>        <chr>        <int>         <int>
#>  1 England     1   1888 1888-12-15 Accrington … Aston …          1             1
#>  2 England     1   1888 1889-01-19 Accrington … Blackb…          0             2
#>  3 England     1   1888 1889-03-23 Accrington … Bolton…          2             3
#>  4 England     1   1888 1888-12-01 Accrington … Burnley          5             1
#>  5 England     1   1888 1888-10-13 Accrington … Derby …          6             2
#>  6 England     1   1888 1888-12-29 Accrington … Everton          3             1
#>  7 England     1   1888 1889-01-26 Accrington … Notts …          1             2
#>  8 England     1   1888 1888-10-20 Accrington … Presto…          0             0
#>  9 England     1   1888 1889-04-20 Accrington … Stoke …          2             0
#> 10 England     1   1888 1888-11-24 Accrington … West B…          2             1
#> # … with 191,994 more rows
uss_get_matches("italy", season == 1934)
#> # A tibble: 240 × 8
#>    country  tier season date       home         visitor goals_home goals_visitor
#>    <chr>   <int>  <int> <date>     <chr>        <chr>        <int>         <int>
#>  1 Italy       1   1934 1934-09-30 Lazio Roma   US Liv…          6             1
#>  2 Italy       1   1934 1934-09-30 Torino FC    Unione…          3             1
#>  3 Italy       1   1934 1934-09-30 Sampierdare… Bologn…          2             1
#>  4 Italy       1   1934 1934-09-30 SSC Napoli   US Ale…          0             1
#>  5 Italy       1   1934 1934-09-30 ACF Fiorent… AS Roma          4             1
#>  6 Italy       1   1934 1934-09-30 Brescia Cal… Juvent…          0             2
#>  7 Italy       1   1934 1934-09-30 Inter        US Pal…          3             0
#>  8 Italy       1   1934 1934-09-30 Pro Vercelli AC Mil…          1             2
#>  9 Italy       1   1934 1934-10-07 AC Milan     ACF Fi…          1             1
#> 10 Italy       1   1934 1934-10-07 US Livorno   Inter            1             1
#> # … with 230 more rows