Learn R Programming

ffscrapr (version 1.4.8)

ff_playerscores: Get Player Scoring History

Description

This function returns a tidy dataframe of player scores based on league rules.

Unfortunately, Sleeper has deprecated their player stats endpoint from their supported/open API. Please see ff_scoringhistory() for an alternative reconstruction.

Usage

ff_playerscores(conn, ...)

# S3 method for espn_conn ff_playerscores(conn, limit = 1000, ...)

# S3 method for flea_conn ff_playerscores(conn, page_limit = NULL, ...)

# S3 method for mfl_conn ff_playerscores(conn, season, week, ...)

# S3 method for sleeper_conn ff_playerscores(conn, ...)

Value

A tibble of historical player scoring

Arguments

conn

the list object created by ff_connect()

...

other arguments (currently unused)

limit

A numeric describing the number of players to return - default 1000

page_limit

A numeric describing the number of pages to return - default NULL returns all available

season

the season of interest - generally only the most recent 2-3 seasons are available

week

a numeric vector (ie 1:17) or one of YTD (year-to-date) or AVG (average to date)

Methods (by class)

  • ff_playerscores(espn_conn): ESPN: returns total points for season and average per game, for both current and previous season.

  • ff_playerscores(flea_conn): Fleaflicker: returns the season, season average, and standard deviation

  • ff_playerscores(mfl_conn): MFL: returns the player fantasy scores for each week (not the actual stats)

  • ff_playerscores(sleeper_conn): Sleeper: Deprecated their open API endpoint for player scores

See Also

ff_scoringhistory

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_playerscores(conn, limit = 5)
}) # end try
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  conn <- fleaflicker_connect(2020, 312861)
  ff_playerscores(conn, page_limit = 2)
}) # end try
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  sfb_conn <- mfl_connect(2020, league_id = 65443)
  ff_playerscores(conn = sfb_conn, season = 2019, week = "YTD")
}) # end try
# }

Run the code above in your browser using DataLab