Learn R Programming

ffscrapr (version 1.4.8)

ff_scoringhistory: Get League-Specific Scoring History

Description

(Experimental!) This function reads your league's ff_scoring rules and maps them to nflfastr week-level data. Not all of the scoring rules from your league may have nflfastr equivalents, but most of the common ones are available!

Usage

ff_scoringhistory(conn, season, ...)

# S3 method for espn_conn ff_scoringhistory(conn, season = 1999:nflreadr::most_recent_season(), ...)

# S3 method for flea_conn ff_scoringhistory(conn, season = 1999:nflreadr::most_recent_season(), ...)

# S3 method for mfl_conn ff_scoringhistory(conn, season = 1999:nflreadr::most_recent_season(), ...)

# S3 method for sleeper_conn ff_scoringhistory(conn, season = 1999:nflreadr::most_recent_season(), ...)

# S3 method for template_conn ff_scoringhistory(conn, season = 1999:nflreadr::most_recent_season(), ...)

Value

A tidy dataframe of weekly fantasy scoring data, one row per player per week

Arguments

conn

a conn object created by ff_connect()

season

season a numeric vector of seasons (earliest available year is 1999)

...

other arguments

Methods (by class)

  • ff_scoringhistory(espn_conn): ESPN: returns scoring history in a flat table, one row per player per week.

  • ff_scoringhistory(flea_conn): Fleaflicker: returns scoring history in a flat table, one row per player per week.

  • ff_scoringhistory(mfl_conn): MFL: returns scoring history in a flat table, one row per player per week.

  • ff_scoringhistory(sleeper_conn): Sleeper: returns scoring history in a flat table, one row per player per week.

  • ff_scoringhistory(template_conn): template: returns scoring history in a flat table, one row per player per week.

See Also

Examples

Run this code
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  conn <- espn_connect(season = 2020, league_id = 899513)
  ff_scoringhistory(conn, season = 2020)
}) # end try
# }

# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  conn <- fleaflicker_connect(2020, 312861)
  ff_scoringhistory(conn, season = 2020)
}) # 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_scoringhistory(ssb_conn, season = 2020)
}) # end try
# }

# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  conn <- ff_connect(platform = "sleeper", league_id = "522458773317046272", season = 2020)
  ff_scoringhistory(conn, season = 2020)
}) # end try
# }

# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  template_conn <- ff_template(scoring_type = "sfb11", roster_type = "sfb11")
  ff_scoringhistory(template_conn, season = 2020)
}) # end try
# }

Run the code above in your browser using DataLab