Skip to contents

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 espn_conn
ff_standings(conn, ...)

# S3 method for flea_conn
ff_standings(conn, include_allplay = TRUE, include_potentialpoints = TRUE, ...)

# S3 method for mfl_conn
ff_standings(conn, ...)

# S3 method for 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.

Value

A tidy dataframe of standings data

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 franch…¹ leagu…² h2h_w…³ h2h_l…⁴ h2h_t…⁵ h2h_w…⁶ point…⁷ point…⁸
#>           <int> <chr>      <int>   <int>   <int>   <int>   <dbl>   <dbl>   <dbl>
#>  1            1 "The Ea…       7       3       9       0   0.25    1313.   1587.
#>  2            2 "Coom  …       3       7       5       0   0.583   1561.   1608.
#>  3            3 "PAKI S…       6       4       8       0   0.333   1484.   1573.
#>  4            4 "I'm Al…       5       7       5       0   0.583   1448.   1495.
#>  5            5 "The Ju…       1       9       3       0   0.75    1620.   1472.
#>  6            6 "OBJ's …       4       8       4       0   0.667   1609.   1420.
#>  7            7 "Tony E…       9       5       7       0   0.417   1677.   1592.
#>  8            8 "Big Co…       8       6       6       0   0.5     1480.   1385.
#>  9            9 "RAFI C…       2       7       5       0   0.583   1562.   1521.
#> 10           10 "Austin…      10       4       8       0   0.333   1336.   1434.
#> # … with 3 more variables: allplay_wins <dbl>, allplay_losses <dbl>,
#> #   allplay_winpct <dbl>, and abbreviated variable names ¹​franchise_name,
#> #   ²​league_rank, ³​h2h_wins, ⁴​h2h_losses, ⁵​h2h_ties, ⁶​h2h_winpct, ⁷​points_for,
#> #   ⁸​points_against
# }

# \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 franch…¹ h2h_w…² h2h_wlt allpl…³ point…⁴ point…⁵ avg_p…⁶ avg_p…⁷
#>    <chr>        <chr>      <dbl> <chr>     <dbl>   <dbl>   <dbl>   <dbl>   <dbl>
#>  1 0009         Team Li…   0.769 10-3-0    0.725   2063.   1862.    159.    143.
#>  2 0010         Team Yo…   0.692 9-4-0     0.65    1956.   1706.    150.    131.
#>  3 0014         Team Lu…   0.769 10-3-0    0.72    2086.   1882.    160.    145.
#>  4 0003         Team Do…   0.462 6-7-0     0.615   1937.   1957.    149     151.
#>  5 0006         Team Ki…   0.615 8-5-0     0.68    2138.   1864.    164.    143.
#>  6 0011         Team Di…   0.615 8-5-0     0.56    1927.   1786.    148.    137.
#>  7 0008         Team Bo…   0.538 7-6-0     0.462   1820.   1861.    140     143.
#>  8 0007         Team Ki…   0.538 7-6-0     0.545   1829.   1800.    141.    138.
#>  9 0002         Team Si…   0.462 6-7-0     0.328   1623.   1719.    125.    132.
#> 10 0004         Team Ic…   0.385 5-8-0     0.495   1852.   1823.    142.    140.
#> 11 0005         Team Dr…   0.385 5-8-0     0.368   1698.   1874.    131.    144.
#> 12 0013         Team Ne…   0.231 3-10-0    0.26    1553.   1828.    119.    141.
#> 13 0012         Team Me…   0.308 4-9-0     0.396   1708.   1865.    131.    144.
#> 14 0001         Team Pi…   0.231 3-10-0    0.151   1459.   1821.    112.    140.
#> # … with 1 more variable: faab_balance <dbl>, and abbreviated variable names
#> #   ¹​franchise_name, ²​h2h_winpct, ³​allplay_winpct, ⁴​points_for,
#> #   ⁵​points_against, ⁶​avg_points_for, ⁷​avg_points_against
# }

# \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 franch…¹ h2h_w…² h2h_l…³ h2h_t…⁴ h2h_w…⁵ point…⁶ point…⁷ poten…⁸
#>           <int> <chr>      <int>   <int>   <int>   <dbl>   <dbl>   <dbl>   <dbl>
#>  1            1 Fake Ne…       8       5       0  0.615    1271.   1278.   1632.
#>  2            2 KingGabe       1      12       0  0.0769    887.   1245.   1019.
#>  3            3 solarpo…       8       5       0  0.615    1413.   1327.   1767.
#>  4            4 The FAN…       8       5       0  0.615    1441.   1237.   1823.
#>  5            5 Barbari…       6       7       0  0.462    1281.   1121.   1585.
#>  6            6 sox05syd       8       5       0  0.615    1259.   1159.   1643.
#>  7            7 Flipade…      10       3       0  0.769    1274.   1124.   1554.
#>  8            8 Hocka F…       7       6       0  0.538    1186.   1281.   1558.
#>  9            9 ZPMille…       4       9       0  0.308    1243.   1346.   1463.
#> 10           10 JMLarkin       1      12       0  0.0769    871.   1289.   1106.
#> 11           11 Permian…       8       5       0  0.615    1415.   1215.   1763.
#> 12           12 jaydk          9       4       0  0.692    1396.   1314.   1763.
#> # … with 3 more variables: allplay_wins <dbl>, allplay_losses <dbl>,
#> #   allplay_winpct <dbl>, and abbreviated variable names ¹​franchise_name,
#> #   ²​h2h_wins, ³​h2h_losses, ⁴​h2h_ties, ⁵​h2h_winpct, ⁶​points_for,
#> #   ⁷​points_against, ⁸​potential_points
# }