Fantasy Football Data

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:

  1. My Team
    • Overview
    • Stats (TBD)
    • Schedule (TBD)
    • News
    • Projections (TBD)
    • Ranks (TBD)
  2. League
    • League Home
    • Settings
    • Members
    • Rosters
    • Schedule
    • Message Board
    • Transaction Counter
    • History
    • Draft Recap
    • Email League
    • Recent Activity
  3. Players
    • Add Players
    • Watch List
    • Scoring Leaders
    • Live Draft Trends
    • Points Against
    • Added / Dropped
    • Player News
    • Projections
    • Budget Summary
    • Offers Report
    • Stat Corrections
  4. FantasyCast
  5. Scoreboard
  6. Standings
  7. Opposing Teams
  8. LM Tools
    • League Membership Tools
    • Draft Tools
    • League and Scoring Settings Tools
    • Roster Tools
    • Schedule and Standings Tools
    • Miscellaneous Tools

My Team

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.

Overview

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)]

News

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)

League

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())

Settings

Draft

draft_settings()

Rosters

roster_settings()

Scoring

scoring_settings()

Transactions and Keepers

acquisition_settings()

Schedule

schedule_settings()

Members

league_members()

Rosters

team_roster(scoringPeriodId = 1)

Schedule

tidy_schedule(scoringPeriodId = 1)

Message Board

league_messages(scoringPeriodId = 1)

Transaction Counter

transaction_counter()

Draft Recap

draft_recap()

Recent Activity

recent_activity(scoringPeriodId = 1)

Players

list_players(limit = 10, proTeam = "Mia", status = "ALL")

Scoreboard

live_scoring()

Standings

league_standings()


Try the fflr package in your browser

Any scripts or data that you put into this service are public.

fflr documentation built on Sept. 14, 2023, 9:10 a.m.