Runs a function fun twice, once with the leagueHistory set to TRUE and once set to FALSE. Combined the output of both runs into a single data frame.

combine_history(fun, ...)

Arguments

fun

A function with the leagueHistory argument.

...

Additional arguments passed to the function used in fun.

Value

A data frame of combined outputs.

Examples

combine_history(tidy_scores, leagueId = "252353")
#> # A tibble: 1,354 × 9
#>    seasonId matchupPeriodId matchupId teamId abbrev isHome totalPoints isWinner
#>       <int>           <int>     <int>  <int> <fct>  <lgl>        <dbl> <lgl>   
#>  1     2015               1         0      7 GRIZ   TRUE            99 FALSE   
#>  2     2015               1         0      4 BILL   FALSE          111 TRUE    
#>  3     2015               1         1      5 BREW   TRUE            74 FALSE   
#>  4     2015               1         1      8 CHAR   FALSE          107 TRUE    
#>  5     2015               1         2      2 LOVE   TRUE           117 TRUE    
#>  6     2015               1         2      1 GUS    FALSE          100 FALSE   
#>  7     2015               1         3      6 K5     TRUE           111 TRUE    
#>  8     2015               1         3      3 PEPE   FALSE           74 FALSE   
#>  9     2015               2         4      4 BILL   TRUE            67 FALSE   
#> 10     2015               2         4      8 CHAR   FALSE           94 TRUE    
#> # ℹ 1,344 more rows
#> # ℹ 1 more variable: expectedWins <dbl>