Learn R Programming

ffscrapr (version 1.4.0)

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:2020, ...)

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

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

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

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)

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

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

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

  • sleeper_conn: Sleeper: 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

Run this code
# NOT RUN {
conn <- espn_connect(season = 2020, league_id = 899513)
ff_scoringhistory(conn)
# }
# NOT RUN {
# }
# NOT RUN {
#'
conn <- fleaflicker_connect(2020, 312861)
x <- ff_scoringhistory(conn, season = 2020)
x
# }
# NOT RUN {
# }
# NOT RUN {
# ssb_conn <- ff_connect(platform = "mfl", league_id = 54040, season = 2020)
# ff_scoringhistory(ssb_conn)
# }
# NOT RUN {
# }
# NOT RUN {
#'
conn <- ff_connect(platform = "sleeper", league_id = "522458773317046272", season = 2020)
ff_scoringhistory(conn, season = 2020)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab