Skip to contents

Gets league-play data for each game, from engsoccerdata, returning a tibble in a standardised format. You can pass in filtering expressions via the dots (...), these are evaluated using dplyr::filter(). Filtering is the last step; it operates on the returned data.

Usage

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

Arguments

country

character scalar, specifies the league. uss_countries() returns choices available from engsoccerdata

...

<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

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

Details

uss_countries() returns the available choices; "england" is the default.

This function relies on an internal function, uss_make_matches(), to parse the source data; to speed up the performance, a memoised (caching) version of this function is used, uss_make_matches_mem().

Examples

uss_get_matches("england")
#> # A tibble: 192,004 × 8
#>    country tier  season date       home         visitor goals_home goals_visitor
#>    <chr>   <fct>  <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