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.

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…¹ goals…²
#>    <chr>   <fct>  <int> <date>     <chr>           <chr>           <int>   <int>
#>  1 England 1       1888 1888-12-15 Accrington F.C. Aston Villa         1       1
#>  2 England 1       1888 1889-01-19 Accrington F.C. Blackburn Ro…       0       2
#>  3 England 1       1888 1889-03-23 Accrington F.C. Bolton Wande…       2       3
#>  4 England 1       1888 1888-12-01 Accrington F.C. Burnley             5       1
#>  5 England 1       1888 1888-10-13 Accrington F.C. Derby County        6       2
#>  6 England 1       1888 1888-12-29 Accrington F.C. Everton             3       1
#>  7 England 1       1888 1889-01-26 Accrington F.C. Notts County        1       2
#>  8 England 1       1888 1888-10-20 Accrington F.C. Preston Nort…       0       0
#>  9 England 1       1888 1889-04-20 Accrington F.C. Stoke City          2       0
#> 10 England 1       1888 1888-11-24 Accrington F.C. West Bromwic…       2       1
#> # … with 191,994 more rows, and abbreviated variable names ¹​goals_home,
#> #   ²​goals_visitor
#> # ℹ Use `print(n = ...)` to see more rows
uss_get_matches("italy", season == 2000) |> dplyr::glimpse()
#> Rows: 306
#> Columns: 8
#> $ country       <chr> "Italy", "Italy", "Italy", "Italy", "Italy", "Italy", "I…
#> $ tier          <fct> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
#> $ season        <int> 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 20…
#> $ date          <date> 2000-10-01, 2000-10-01, 2000-10-01, 2000-10-01, 2000-10…
#> $ home          <chr> "Udinese Calcio", "AS Roma", "AC Perugia", "Reggina Calc…
#> $ visitor       <chr> "Brescia Calcio", "Bologna FC", "US Lecce", "Inter", "Ju…
#> $ goals_home    <int> 4, 2, 1, 2, 1, 2, 2, 1, 2, 3, 1, 1, 0, 2, 2, 0, 2, 3, 3,…
#> $ goals_visitor <int> 2, 0, 1, 1, 2, 0, 2, 1, 2, 1, 2, 1, 4, 0, 1, 0, 1, 0, 1,…