library(footballR)
library(tidyverse)
#> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
#> ✔ ggplot2 3.3.3     ✔ purrr   0.3.4
#> ✔ tibble  3.0.5     ✔ dplyr   1.0.3
#> ✔ tidyr   1.1.2     ✔ stringr 1.4.0
#> ✔ readr   1.4.0     ✔ forcats 0.5.0
#> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
#> ✖ dplyr::filter() masks stats::filter()
#> ✖ dplyr::lag()    masks stats::lag()

x <- download_int_results()

x
#> # A tibble: 41,865 x 9
#>    date       home_team away_team home_score away_score tournament city  country
#>    <date>     <chr>     <chr>          <dbl>      <dbl> <chr>      <chr> <chr>  
#>  1 1872-11-30 Scotland  England            0          0 Friendly   Glas… Scotla…
#>  2 1873-03-08 England   Scotland           4          2 Friendly   Lond… England
#>  3 1874-03-07 Scotland  England            2          1 Friendly   Glas… Scotla…
#>  4 1875-03-06 England   Scotland           2          2 Friendly   Lond… England
#>  5 1876-03-04 Scotland  England            3          0 Friendly   Glas… Scotla…
#>  6 1876-03-25 Scotland  Wales              4          0 Friendly   Glas… Scotla…
#>  7 1877-03-03 England   Scotland           1          3 Friendly   Lond… England
#>  8 1877-03-05 Wales     Scotland           0          2 Friendly   Wrex… Wales  
#>  9 1878-03-02 Scotland  England            7          2 Friendly   Glas… Scotla…
#> 10 1878-03-23 Scotland  Wales              9          0 Friendly   Glas… Scotla…
#> # … with 41,855 more rows, and 1 more variable: neutral <lgl>

summary(x)
#>       date             home_team          away_team           home_score    
#>  Min.   :1872-11-30   Length:41865       Length:41865       Min.   : 0.000  
#>  1st Qu.:1978-05-03   Class :character   Class :character   1st Qu.: 1.000  
#>  Median :1997-11-09   Mode  :character   Mode  :character   Median : 1.000  
#>  Mean   :1991-02-28                                         Mean   : 1.744  
#>  3rd Qu.:2009-06-30                                         3rd Qu.: 2.000  
#>  Max.   :2020-12-09                                         Max.   :31.000  
#>    away_score      tournament            city             country         
#>  Min.   : 0.000   Length:41865       Length:41865       Length:41865      
#>  1st Qu.: 0.000   Class :character   Class :character   Class :character  
#>  Median : 1.000   Mode  :character   Mode  :character   Mode  :character  
#>  Mean   : 1.186                                                           
#>  3rd Qu.: 2.000                                                           
#>  Max.   :21.000                                                           
#>   neutral       
#>  Mode :logical  
#>  FALSE:31551    
#>  TRUE :10314    
#>                 
#>                 
#> 

x %>% filter(home_score > 30)
#> # A tibble: 1 x 9
#>   date       home_team away_team home_score away_score tournament city  country
#>   <date>     <chr>     <chr>          <dbl>      <dbl> <chr>      <chr> <chr>  
#> 1 2001-04-11 Australia American…         31          0 FIFA Worl… Coff… Austra…
#> # … with 1 more variable: neutral <lgl>