Get Standings
Source:R/0_generics.R
, R/espn_standings.R
, R/flea_standings.R
, and 2 more
ff_standings.Rd
This function returns a tidy dataframe of season-long fantasy team stats, including H2H wins as well as points, potential points, and all-play.
Usage
ff_standings(conn, ...)
# S3 method for class 'espn_conn'
ff_standings(conn, ...)
# S3 method for class 'flea_conn'
ff_standings(conn, include_allplay = TRUE, include_potentialpoints = TRUE, ...)
# S3 method for class 'mfl_conn'
ff_standings(conn, ...)
# S3 method for class 'sleeper_conn'
ff_standings(conn, ...)
Arguments
- conn
a conn object created by
ff_connect()
- ...
arguments passed to other methods (currently none)
- include_allplay
TRUE/FALSE - return all-play win pct calculation? defaults to TRUE
- include_potentialpoints
TRUE/FALSE - return potential points calculation? defaults to TRUE.
Methods (by class)
ff_standings(espn_conn)
: ESPN: returns standings and points data.ff_standings(flea_conn)
: Fleaflicker: returns H2H/points/all-play/best-ball data in a table.ff_standings(mfl_conn)
: MFL: returns H2H/points/all-play/best-ball data in a table.ff_standings(sleeper_conn)
: Sleeper: returns all standings and points data and manually calculates allplay results.
Examples
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
espn_conn <- espn_connect(season = 2020, league_id = 899513)
ff_standings(espn_conn)
}) # end try
#> # A tibble: 10 × 12
#> franchise_id franchise_name league_rank h2h_wins h2h_losses h2h_ties
#> <int> <chr> <int> <int> <int> <int>
#> 1 1 "The Early GGod" 7 3 9 0
#> 2 2 "Coom Dumpster" 3 7 5 0
#> 3 3 "PAKI STANS" 6 4 8 0
#> 4 4 "I'm Also Sad " 5 7 5 0
#> 5 5 "The Juggernaut" 1 9 3 0
#> 6 6 "OBJ's Personal Porta … 4 8 4 0
#> 7 7 "Tony El Tigre" 9 5 7 0
#> 8 8 "Big Coomers" 8 6 6 0
#> 9 9 "RAFI CUNADO" 2 7 5 0
#> 10 10 "Austin 🐐Drew Lock🐐" 10 4 8 0
#> # ℹ 6 more variables: h2h_winpct <dbl>, points_for <dbl>, points_against <dbl>,
#> # allplay_wins <dbl>, allplay_losses <dbl>, allplay_winpct <dbl>
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
conn <- fleaflicker_connect(season = 2020, league_id = 206154)
x <- ff_standings(conn)
}) # end try
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
ssb_conn <- ff_connect(platform = "mfl", league_id = 54040, season = 2020)
ff_standings(ssb_conn)
}) # end try
#> Warning: There was 1 warning in `mutate()`.
#> ℹ In argument: `fname = .Primitive("as.double")(fname)`.
#> Caused by warning:
#> ! NAs introduced by coercion
#> # A tibble: 14 × 10
#> franchise_id franchise_name h2h_winpct h2h_wlt allplay_winpct points_for
#> <chr> <chr> <dbl> <chr> <dbl> <dbl>
#> 1 0009 Team Link 0.769 10-3-0 0.725 2063.
#> 2 0010 Team Yoshi 0.692 9-4-0 0.65 1956.
#> 3 0014 Team Luigi 0.769 10-3-0 0.72 2086.
#> 4 0003 Team Donkey Kong 0.462 6-7-0 0.615 1937.
#> 5 0006 Team King Dedede 0.615 8-5-0 0.68 2138.
#> 6 0011 Team Diddy Kong 0.615 8-5-0 0.56 1927.
#> 7 0008 Team Bowser 0.538 7-6-0 0.462 1820.
#> 8 0007 Team Kirby 0.538 7-6-0 0.545 1829.
#> 9 0002 Team Simon Belmont 0.462 6-7-0 0.328 1623.
#> 10 0004 Team Ice Climbers 0.385 5-8-0 0.495 1852.
#> 11 0005 Team Dr. Mario 0.385 5-8-0 0.368 1698.
#> 12 0013 Team Ness 0.231 3-10-0 0.26 1553.
#> 13 0012 Team Mewtwo 0.308 4-9-0 0.396 1708.
#> 14 0001 Team Pikachu 0.231 3-10-0 0.151 1459.
#> # ℹ 4 more variables: points_against <dbl>, avg_points_for <dbl>,
#> # avg_points_against <dbl>, faab_balance <dbl>
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
jml_conn <- ff_connect(platform = "sleeper", league_id = "522458773317046272", season = 2020)
ff_standings(jml_conn)
}) # end try
#> # A tibble: 12 × 12
#> franchise_id franchise_name h2h_wins h2h_losses h2h_ties h2h_winpct
#> <int> <chr> <int> <int> <int> <dbl>
#> 1 1 Fake News 8 5 0 0.615
#> 2 2 KingGabe 1 12 0 0.0769
#> 3 3 solarpool 8 5 0 0.615
#> 4 4 The FANTom Menace 8 5 0 0.615
#> 5 5 Barbarians 6 7 0 0.462
#> 6 6 sox05syd 8 5 0 0.615
#> 7 7 Flipadelphia05 10 3 0 0.769
#> 8 8 Hocka Flocka 7 6 0 0.538
#> 9 9 ZPMiller97 4 9 0 0.308
#> 10 10 JMLarkin 1 12 0 0.0769
#> 11 11 Permian Panthers 8 5 0 0.615
#> 12 12 jaydk 9 4 0 0.692
#> # ℹ 6 more variables: points_for <dbl>, points_against <dbl>,
#> # potential_points <dbl>, allplay_wins <dbl>, allplay_losses <dbl>,
#> # allplay_winpct <dbl>
# }