knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) if (!interactive()) { options(width = 90) }
library(fflr) packageVersion("fflr") ffl_id(leagueId = "42654852")
This vignette will demonstrate the fflr functions used to reach equivalency with the ESPN fantasy football website. The website has eight section headers with various subsections:
The My Team page presents an overview of, well, your fantasy team. From this page, a team manager can set their lineup and see statistics and news on the players on their roster.
There are six subsections on the My Team page.
The team_roster()
function returns all rosters in a league. The output of
this function is organized to replicate the layout of the table found on the
website. Players are listed in order of their "slot" with name and team
information followed by projected and actual scores and ownership statistics.
my_team <- team_roster(scoringPeriodId = 1)[[1]] # select first roster my_team[, -(1:3)]
The player_outlook()
and player_news()
functions return news on your roster.
The first returns all outlooks by player and week and cannot be refined beyond
setting a limit
of players to return (in order of rank).
player_outlook(limit = 1)
The second fiction takes a single playerId
value and returns all the recent
news on that player, including premium stories in HTML format.
player_news(playerId = "3139477", parseHTML = FALSE)
ESPN fantasy leagues have their own unique settings and structure. This package has been tested for a very narrow subset of those possible settings.
league_info(leagueId = "42654852") league_name() league_size() str(league_status())
draft_settings()
roster_settings()
scoring_settings()
acquisition_settings()
schedule_settings()
league_members()
team_roster(scoringPeriodId = 1)
tidy_schedule(scoringPeriodId = 1)
league_messages(scoringPeriodId = 1)
transaction_counter()
draft_recap()
recent_activity(scoringPeriodId = 1)
list_players(limit = 10, proTeam = "Mia", status = "ALL")
live_scoring()
league_standings()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.