ff_scoringhistory: Get League-Specific Scoring History

View source: R/0_generics.R

ff_scoringhistoryR Documentation

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 class 'espn_conn'
ff_scoringhistory(conn, season = 1999:nflreadr::most_recent_season(), ...)

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

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

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

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

Arguments

conn

a conn object created by ff_connect()

season

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

...

other arguments

Value

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

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

https://www.nflfastr.com/reference/load_player_stats.html

Examples


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



try({ # try only shown here because sometimes CRAN checks are weird
  conn <- fleaflicker_connect(2020, 312861)
  ff_scoringhistory(conn, season = 2020)
}) # end try



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



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



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



ffscrapr documentation built on Feb. 16, 2023, 10:55 p.m.