R/0_generics.R
, R/espn_transactions.R
, R/flea_transactions.R
, and 2 more
ff_transactions.Rd
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.
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, ...)
conn | the list object created by |
---|---|
... | 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 | `r lifecycle::badge("deprecated")` - now returns custom players by default |
week | A week filter for transactions - 1 returns all offseason transactions. Default 1:17 returns all transactions. |
A tidy dataframe of transaction data
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.
if (FALSE) { # 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) } # \donttest{ conn <- fleaflicker_connect(season = 2020, league_id = 312861) ff_transactions(conn)#> # A tibble: 231 x 12 #> timestamp type type_desc franchise_id franchise_name player_id #> <dttm> <chr> <chr> <int> <chr> <glue> #> 1 2021-04-13 16:51:42 free_ag… dropped 1581721 Mjenkyns2004's… 11187 #> 2 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 15730 #> 3 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 13168 #> 4 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 15639 #> 5 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 15636 #> 6 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 7444 #> 7 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 13040 #> 8 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 1732 #> 9 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 12951 #> 10 2021-03-28 14:34:08 free_ag… dropped 1581726 SCJaguars's Te… 9305 #> # … with 221 more rows, and 6 more variables: player_name <glue>, pos <chr>, #> # team <chr>, trade_partner_id <int>, trade_partner_name <chr>, #> # trade_id <int>#> # A tibble: 1,146 x 12 #> timestamp type type_desc franchise_id franchise_name player_id #> <dttm> <chr> <chr> <chr> <chr> <chr> #> 1 2019-12-19 11:56:49 FREE_… added 0003 Electric Spiders 13868 #> 2 2019-12-19 11:56:49 FREE_… dropped 0003 Electric Spiders 13387 #> 3 2019-12-19 03:03:13 FREE_… added 0019 Advance Reptilia… 12857 #> 4 2019-12-19 03:03:13 FREE_… dropped 0019 Advance Reptilia… 11186 #> 5 2019-12-19 03:02:26 FREE_… added 0019 Advance Reptilia… 13868 #> 6 2019-12-19 03:02:26 FREE_… dropped 0019 Advance Reptilia… 14305 #> 7 2019-12-15 17:28:15 FREE_… added 0003 Electric Spiders 12197 #> 8 2019-12-15 17:27:28 FREE_… dropped 0003 Electric Spiders 12623 #> 9 2019-12-15 17:27:00 FREE_… added 0003 Electric Spiders 13387 #> 10 2019-12-15 17:26:27 IR deactiva… 0003 Electric Spiders 14138 #> # … with 1,136 more rows, and 6 more variables: player_name <chr>, pos <chr>, #> # team <chr>, bbid_spent <dbl>, trade_partner <chr>, comments <chr># } # \donttest{ jml_conn <- ff_connect(platform = "sleeper", league_id = "522458773317046272", season = 2020) x <- ff_transactions(jml_conn, week = 1:17) # }