Learn R Programming

ffscrapr (version 1.4.7)

ff_transactions: Get League Transactions

Description

This function returns a tidy dataframe of transactions - generally one row per player per transaction per team. Each trade is represented twice, once per each team.

Usage

ff_transactions(conn, ...)

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

# S3 method for flea_conn ff_transactions(conn, franchise_id = NULL, ...)

# S3 method for mfl_conn ff_transactions(conn, custom_players = deprecated(), ...)

# S3 method for sleeper_conn ff_transactions(conn, week = 1:17, ...)

Arguments

conn

the list object created by ff_connect()

...

additional args for other methods

limit

number of most recent transactions to return

franchise_id

fleaflicker returns transactions grouped by franchise id, pass a list here to filter

custom_players

[Deprecated] - now returns custom players by default

week

A week filter for transactions - 1 returns all offseason transactions. Default 1:17 returns all transactions.

Value

A tidy dataframe of transaction data

Methods (by class)

  • espn_conn: ESPN: returns adds, drops, and trades. Requires private/auth-cookie.

  • flea_conn: Fleaflicker: returns all transactions, including free agents, waivers, and trades.

  • mfl_conn: MFL: returns all transactions, including auction, free agents, IR, TS, waivers, and trades.

  • sleeper_conn: Sleeper: returns all transactions, including free agents, waivers, and trades.

Examples

Run this code
# NOT RUN {
# Marked as don't run because this endpoint requires private authentication

conn <- espn_connect(
  season = 2020,
  league_id = 1178049,
  swid = Sys.getenv("TAN_SWID"),
  espn_s2 = Sys.getenv("TAN_ESPN_S2")
)
ff_transactions(conn)
# }
# NOT RUN {
# }
# NOT RUN {
try({ # try only shown here because sometimes CRAN checks are weird
  conn <- fleaflicker_connect(season = 2020, league_id = 312861)
  ff_transactions(conn)
}) # end try
# }
# NOT RUN {
# }
# NOT RUN {
try({ # try only shown here because sometimes CRAN checks are weird
  dlf_conn <- mfl_connect(2019, league_id = 37920)
  ff_transactions(dlf_conn)
}) # end try
# }
# NOT RUN {
try({ # try only shown here because sometimes CRAN checks are weird
  jml_conn <- ff_connect(platform = "sleeper", league_id = "522458773317046272", season = 2020)
  ff_transactions(jml_conn, week = 1:2)
}) # end try
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab