Title: | Wrapper Functions Around 'Sleeper' (Fantasy Sports) API |
---|---|
Description: | For those wishing to interact with the 'Sleeper' (Fantasy Sports) API (<https://docs.sleeper.com/>) without looking too much into its documentation (found at <https://docs.sleeper.com/>), this package offers wrapper functions around the available API calls to make it easier. |
Authors: | Nick Bultman [aut, cre, cph] |
Maintainer: | Nick Bultman <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.2 |
Built: | 2024-11-19 03:06:41 UTC |
Source: | https://github.com/njbultman/sleeperapi |
Gather all information concerning NFL players in list or data frame. Per Sleeper, this should be called once per day at most given the amount of data that it returns. By modifying the 'clean' parameter, either a data frame will be returned or a list. When 'clean' is TRUE, a data frame will be returned. Note that while most data is returned for the data frame, metadata will not be due to its dynamic nature. For example, metadata can be data frames on their own, so attempting to put them in a single data frame is not feasible. One might notice that a metadata column is present, but this is not properly cleanded since there could be NULLs, rookie years, injury overrides, or other miscellaneous columns that could add additional explanatory information. If either of these pieces will be problematic for you, it is recommended to keep 'clean' set to FALSE and parse the default list as you see fit.
get_all_nfl_players(clean = FALSE)
get_all_nfl_players(clean = FALSE)
clean |
Specifies whether a data frame or the default list will be returned (logical) |
Returns a list or data frame containing information about the NFL players.
Nick Bultman, [email protected], December 2021
## Not run: get_all_nfl_players(clean = FALSE) ## Not run: get_all_nfl_players(clean = TRUE)
## Not run: get_all_nfl_players(clean = FALSE) ## Not run: get_all_nfl_players(clean = TRUE)
Given an avatar ID, grab the picture (full or thumbnail) concerning that particular avatar. Note that this function downloads the image into your temporary directory to display it. Then, the function deletes the file before completing. If it would be preferred to keep the image at the temporary location, set the keep_image argument to TRUE (default is FALSE).
get_avatar_picture(avatar_id, type = "full", keep_image = FALSE)
get_avatar_picture(avatar_id, type = "full", keep_image = FALSE)
avatar_id |
Avatar ID generated by Sleeper (character) |
type |
String that is either "full" or "thumbnail" |
keep_image |
FALSE to delete the image after displaying it or TRUE to keep it |
Returns a picture displaying the avatar picture
Nick Bultman, [email protected], October 2021
## Not run: get_avatar_picture("c751b27d9158c1dd41bd33dc7e4bcdde", type = "full", keep_image = FALSE) ## End(Not run)
## Not run: get_avatar_picture("c751b27d9158c1dd41bd33dc7e4bcdde", type = "full", keep_image = FALSE) ## End(Not run)
Given a draft ID, gather draft information for selection.
get_draft(draft_id)
get_draft(draft_id)
draft_id |
Draft ID generated by Sleeper (integer) |
Returns a list containing information about the draft.
Nick Bultman, [email protected], December 2021
## Not run: get_draft(688281872463106048)
## Not run: get_draft(688281872463106048)
Given a draft ID, gather draft pick trades for that draft.
get_draft_pick_trades(draft_id)
get_draft_pick_trades(draft_id)
draft_id |
Draft ID generated by Sleeper (numeric or character) |
Returns a data frame containing information about the draft pick trade(s).
Nick Bultman, [email protected], December 2021
## Not run: get_draft_pick_trades(688281872463106048)
## Not run: get_draft_pick_trades(688281872463106048)
Given a draft ID, gather draft picks (along with other metadata concerning the picks).
get_draft_picks(draft_id)
get_draft_picks(draft_id)
draft_id |
Draft ID generated by Sleeper (numeric or character) |
Returns a data frame containing information about the draft picks.
Nick Bultman, [email protected], December 2021
## Not run: get_draft_picks(688281872463106048)
## Not run: get_draft_picks(688281872463106048)
Given a league ID, grab the data for that league. Includes roster positions, season type, if it is in season, and more.
get_league(league_id)
get_league(league_id)
league_id |
League ID generated by Sleeper (numeric or character) |
Returns a data frame containing information about the league.
Nick Bultman, [email protected], September 2021
## Not run: get_league(688281863499907072)
## Not run: get_league(688281863499907072)
Given a league ID, gather draft information for that league.
get_league_drafts(league_id)
get_league_drafts(league_id)
league_id |
League ID generated by Sleeper (numeric or character) |
Returns a data frame containing draft information for that league.
Nick Bultman, [email protected], December 2021
## Not run: get_league_drafts(688281863499907072)
## Not run: get_league_drafts(688281863499907072)
Given a league ID, grab the data concerning each user. This includes information about the users' mascot, display name, avatar, if they are an owner, if they are a bot, and more.
get_league_users(league_id)
get_league_users(league_id)
league_id |
League ID generated by Sleeper (numeric or character) |
Returns a data frame containing information about the users in the league.
Nick Bultman, [email protected], September 2021
## Not run: get_league_users(688281863499907072)
## Not run: get_league_users(688281863499907072)
Given a league ID, get the loser playoff bracket for the league.
get_loser_playoff_bracket(league_id)
get_loser_playoff_bracket(league_id)
league_id |
League ID generated by Sleeper (numeric or character) |
Returns a data frame containing playoff information for the loser bracket.
Nick Bultman, [email protected], December 2021
## Not run: get_loser_playoff_bracket(688281863499907072)
## Not run: get_loser_playoff_bracket(688281863499907072)
Given the league ID, generate a main data set that can be used for generating quick insights. This includes teams, fantasy points, avatars, divisions, owner IDs, and more.
get_main_data(league_id)
get_main_data(league_id)
league_id |
League ID generated by Sleeper (numeric). |
Returns a data frame containing roster, league user, and overall league information.
Nick Bultman, [email protected], December 2023
## Not run: get_main_data(688281863499907072)
## Not run: get_main_data(688281863499907072)
Given a league ID and week number, grab the matchup data, including player points, total points, starting rosters, and more.
get_matchups(league_id, week)
get_matchups(league_id, week)
league_id |
League ID generated by Sleeper (numeric or character) |
week |
Matchup week (numeric) |
Returns a data frame containing information about the matchups.
Nick Bultman, [email protected], September 2021
## Not run: get_matchups(688281863499907072, 2) ## Not run: get_matchups("688281863499907072", 1)
## Not run: get_matchups(688281863499907072, 2) ## Not run: get_matchups("688281863499907072", 1)
Given a league ID, grab the data concerning each roster in that league. This includes information with the roster wins, losses, ties, fantasy points, and more.
get_rosters(league_id)
get_rosters(league_id)
league_id |
League ID generated by Sleeper (numeric or character) |
Returns a data frame containing information about the rosters in the league.
Nick Bultman, [email protected], September 2021
## Not run: get_rosters(688281863499907072)
## Not run: get_rosters(688281863499907072)
Given a sport abbreviation (NFL, NBA, etc.), return information about the current sport state.
get_sport_state(sport)
get_sport_state(sport)
sport |
Sport that you would like to query (nfl, nba, lcs, etc.) (character) |
Returns a list containing information about the sport state.
Nick Bultman, [email protected], December 2021
## Not run: get_sport_state("nfl")
## Not run: get_sport_state("nfl")
Given a league ID, grab the trades that have occured.
get_traded_picks(league_id)
get_traded_picks(league_id)
league_id |
League ID generated by Sleeper (numeric or character) |
Returns a list containing trades.
Nick Bultman, [email protected], September 2021
## Not run: get_traded_picks(688281863499907072)
## Not run: get_traded_picks(688281863499907072)
Given a league ID and round, grab the transaction data concerning that particular league. This includes adds or drops, whether it was a free agent or a waiver, notes, and more.
get_transactions(league_id, round)
get_transactions(league_id, round)
league_id |
League ID generated by Sleeper (numeric or character) |
round |
round of transactions to gather (can also be thought of as week depending on when your league processes transactions) (numeric) |
Returns a data frame containing information about the round of transactions for that league.
Nick Bultman, [email protected], September 2021
## Not run: get_transactions(688281863499907072, 2)
## Not run: get_transactions(688281863499907072, 2)
Given a sport and type (add or drop), return the top trending players for that selection. More specifically, the player ID and count are returned in a data frame, allowing one to see which players have been added/dropped the most given the particular lookback period (default lookback period of one day).
get_trending_players(sport, type, lookback_hours = 24, limit = 25)
get_trending_players(sport, type, lookback_hours = 24, limit = 25)
sport |
Sport that you would like to query (nfl, nba, etc.) (character) |
type |
Either "add" or "drop" (character) |
lookback_hours |
Number of hours to look back (numeric). Default is 24 |
limit |
Number of results you would like (numeric). Default is 25 |
Returns a data frame containing information (player ID and count) about the trending players.
Nick Bultman, [email protected], December 2021
## Not run: get_trending_players("nfl", "add", 24, 25)
## Not run: get_trending_players("nfl", "add", 24, 25)
Given a user ID, grab the data concerning that particular user. This includes username, user ID, display name, and more.
get_user(user_id)
get_user(user_id)
user_id |
User ID generated by Sleeper (numeric or character) |
Returns a list containing information about the user.
Nick Bultman, [email protected], September 2021
## Not run: get_user(688556535013502976)
## Not run: get_user(688556535013502976)
Given a user ID, sport abbreviation, and season number, gather draft information for that selection.
get_user_drafts(user_id, sport, season)
get_user_drafts(user_id, sport, season)
user_id |
User ID generated by Sleeper (numeric) |
sport |
Sport that you would like to query ("nfl" only supported currently) (character) |
season |
Season that you would like to select (numeric) |
Returns a data frame containing information about the draft(s).
Nick Bultman, [email protected], December 2021
## Not run: get_user_drafts(688556535013502976, "nfl", 2021)
## Not run: get_user_drafts(688556535013502976, "nfl", 2021)
Given a user ID and optional sport and season, grab the league data concerning that particular user. This includes total rosters, scoring settings, roster positions, and more.
get_user_leagues( user_id, sport = "nfl", season = substr(Sys.Date(), start = 1, stop = 4) )
get_user_leagues( user_id, sport = "nfl", season = substr(Sys.Date(), start = 1, stop = 4) )
user_id |
User ID generated by Sleeper (numeric or character) |
sport |
Sport for league information (character) |
season |
Season for league information (numeric or character) |
Returns a data frame containing information about the user.
Nick Bultman, [email protected], September 2021
## Not run: get_user_leagues(688556535013502976) ## Not run: get_user_leagues("688556535013502976", sport = "nfl", season = "2021")
## Not run: get_user_leagues(688556535013502976) ## Not run: get_user_leagues("688556535013502976", sport = "nfl", season = "2021")
Given a league ID and the type of data (all, team, or player data), grab the matchup data for each week that matchup data is available.
get_weekly_matchups(league_id, type = "all")
get_weekly_matchups(league_id, type = "all")
league_id |
League ID generated by Sleeper (numeric or character) |
type |
Type of data returned ("all", "team", "player") (string). |
If type is "all", will return a list containing data frames for both team and player data. Otherwise, will return team or player data depending on what is specified in the type argument. Note that with the player data, the aggregated player points could differ from the total team points due to the custom (manual) points that can be present.
Nick Bultman, [email protected], April 2024
## Not run: get_weekly_matchups(688281863499907072) ## Not run: get_weekly_matchups(688281863499907072, type = "player")
## Not run: get_weekly_matchups(688281863499907072) ## Not run: get_weekly_matchups(688281863499907072, type = "player")
Given a league ID, get the winner playoff bracket for the league.
get_winner_playoff_bracket(league_id)
get_winner_playoff_bracket(league_id)
league_id |
League ID generated by Sleeper (numeric or character) |
Returns a data frame containing playoff information for the winner bracket.
Nick Bultman, [email protected], December 2021
## Not run: get_winner_playoff_bracket(688281863499907072)
## Not run: get_winner_playoff_bracket(688281863499907072)
When using some of the plotting functions, it is recommended to run this function before any plotting begins to ensure the latest player information is present with the package. Per Sleeper, gathering these data should only be done once per day, which is why this is not recommended to implement a call every time to gather player information when a plot is generated. This function will refresh the latest NFL player information and place it in the appropriate place for the plotting functions to grab. Moreover, it will keep that information stored for the duration of the R session.
plot_generate_nfl_player_data()
plot_generate_nfl_player_data()
Returns a message stating if the data refresh was successful or not.
Nick Bultman, [email protected], September 2023
## Not run: plot_generate_nfl_player_data()
## Not run: plot_generate_nfl_player_data()
Given the league ID, generate a dashboard with various plots/tables of the current league. Note that since this is a dashboard, your R session will continuously run until the console is stopped. Stoppage can be achieved by pressing Control + C on the keyboard.
plot_league_dashboard(league_id)
plot_league_dashboard(league_id)
league_id |
League ID generated by Sleeper (numeric). |
Returns a dashboard of the current league state.
Nick Bultman, [email protected], March 2024
## Not run: plot_league_dashboard(688281863499907072)
## Not run: plot_league_dashboard(688281863499907072)
Given the league ID, generate a table showing team names and their associated statistics (wins, losses, points for/against, etc.).
plot_league_information_table( league_id, font_color = "inherit", win_loss_fill = "RdYlGn", fpts_for_fill = "lightgreen", fpts_against_fill = "#f68383" )
plot_league_information_table( league_id, font_color = "inherit", win_loss_fill = "RdYlGn", fpts_for_fill = "lightgreen", fpts_against_fill = "#f68383" )
league_id |
League ID generated from Sleeper (numeric). |
font_color |
Font color, hex code or name (string). |
win_loss_fill |
String describing the brewer.pal color palette selection. Can see all options through RColorBrewer::display.brewer.all() (string). |
fpts_for_fill |
Bar color, name or hex, for each fantasy points for cell by team (string). |
fpts_against_fill |
Bar color, name or hex, for each fantasy points against cell by team (string). |
Returns a table containing team names and their associated statistics.
Nick Bultman, [email protected], January 2024
## Not run: plot_league_information_table(688281863499907072) ## Not run: plot_league_information_table(688281863499907072, font_color = "#ee5050")
## Not run: plot_league_information_table(688281863499907072) ## Not run: plot_league_information_table(688281863499907072, font_color = "#ee5050")
Given the league ID, generate a table showing display names and their associated streaks (2W, 5L, etc.).
plot_league_streaks_table( league_id, font_color = "inherit", win_streak_font_color = "lightgreen", lose_streak_font_color = "#f68383" )
plot_league_streaks_table( league_id, font_color = "inherit", win_streak_font_color = "lightgreen", lose_streak_font_color = "#f68383" )
league_id |
League ID generated from Sleeper (numeric). |
font_color |
Header font color, hex code or name (string). |
win_streak_font_color |
Font color, hex code or name, for teams with winning streak (string). |
lose_streak_font_color |
Font color, hex code or name, for teams with losing streak (string). |
Returns a table containing display names and their streaks.
Nick Bultman, [email protected], January 2024
## Not run: plot_league_streaks_table(688281863499907072) ## Not run: plot_league_streaks_table(688281863499907072, font_color = "red")
## Not run: plot_league_streaks_table(688281863499907072) ## Not run: plot_league_streaks_table(688281863499907072, font_color = "red")
This function will generate a table containing general information (name, age, college, etc.) concerning all the NFL players that Sleeper has data on.
plot_nfl_player_data_table(font_color = "inherit")
plot_nfl_player_data_table(font_color = "inherit")
font_color |
Font color, name or hex (string). |
Returns a table showing general NFL player information.
Nick Bultman, [email protected], March 2024
## Not run: plot_nfl_player_data_table() ## Not run: plot_nfl_player_data_table(font_color = "green")
## Not run: plot_nfl_player_data_table() ## Not run: plot_nfl_player_data_table(font_color = "green")
This function will generate a plot showing counts of NFL players by high school state. Colors can be manually defined for high and low values of each state's count.
plot_nfl_player_high_school_state( title = "<b>NFL Players by High School State</b>", high_fill = "lightgreen", low_fill = "white" )
plot_nfl_player_high_school_state( title = "<b>NFL Players by High School State</b>", high_fill = "lightgreen", low_fill = "white" )
title |
Title for plot (string). |
high_fill |
Fill color, name or hex, for high value states (string). |
low_fill |
Fill color, name or hex, for low value states (string). |
Returns a plot containing information about counts for NFL players by their high school state.
Nick Bultman, [email protected], March 2024
## Not run: plot_nfl_player_high_school_state() ## Not run: plot_nfl_player_high_school_state(title = "Test")
## Not run: plot_nfl_player_high_school_state() ## Not run: plot_nfl_player_high_school_state(title = "Test")
This function will generate a bar plot showing counts of NFL players by college. The total number of colleges returned is specified by the user.
plot_nfl_top_colleges( title = "<b>NFL Players by College</b>", tick_color = "black", number = 10, fill_color = "black" )
plot_nfl_top_colleges( title = "<b>NFL Players by College</b>", tick_color = "black", number = 10, fill_color = "black" )
title |
Title for plot (string). |
tick_color |
Color for tick labels (string). |
number |
Number of colleges to show (numeric). |
fill_color |
Bar color, number or hex (string). |
Returns a plot containing information about counts for NFL players by their college.
Nick Bultman, [email protected], March 2024
## Not run: plot_nfl_player_college() ## Not run: plot_nfl_player_college(title = "TestTitle", tick_color = "green", number = 5)
## Not run: plot_nfl_player_college() ## Not run: plot_nfl_player_college(title = "TestTitle", tick_color = "green", number = 5)
Given the league ID, plot the regular season league rankings. This is done by assigning positive points to wins and negative points to losses and then also adding in fantasy points for. The calculation can be seen in the get_main_data function.
plot_regular_season_rankings( league_id, title = "<b>Regular Season Rankings</b>", tick_color = "black", rank_high_fill = "lightgreen", rank_low_fill = "#f68383" )
plot_regular_season_rankings( league_id, title = "<b>Regular Season Rankings</b>", tick_color = "black", rank_high_fill = "lightgreen", rank_low_fill = "#f68383" )
league_id |
League ID assigned by Sleeper (numeric). |
title |
Title for plot, which can include HTML formatting (string). |
tick_color |
Font color, name or hex, for display names (string). |
rank_high_fill |
Bar color, name or hex, for highest rank (string). |
rank_low_fill |
Bar color, name or hex, for lowest rank (string). |
Returns a plot containing the regular season league rankings.
Nick Bultman, [email protected], January 2024
## Not run: plot_regular_season_rankings(688281863499907072) ## Not run: plot_regular_season_rankings(688281863499907072, title = "test", tick_color = "red")
## Not run: plot_regular_season_rankings(688281863499907072) ## Not run: plot_regular_season_rankings(688281863499907072, title = "test", tick_color = "red")
Given the number of hours to look back, a limit of how many players to return, a color for labels, and a title, display a figure showing the top NFL additions and drops.
plot_trending_players( lookback_hours = 24, limit = 10, tick_color = "black", title = "Trending Adds/Drops", drop_fill = "#f68383", add_fill = "lightgreen" )
plot_trending_players( lookback_hours = 24, limit = 10, tick_color = "black", title = "Trending Adds/Drops", drop_fill = "#f68383", add_fill = "lightgreen" )
lookback_hours |
Number of hours to look back (numeric). |
limit |
Number of results you would like (numeric). |
tick_color |
Font color, name or hex, for display names (string). |
title |
Plot title - default is "Trending Adds/Drops" (string). |
drop_fill |
Bar color, name or hex, for drops (string). |
add_fill |
Bar color, name or hex, for adds (string). |
Returns a plot containing information (name and count) about the trending players.
Nick Bultman, [email protected], September 2023
## Not run: plot_trending_players(lookback_hours = 24, limit = 10) ## Not run: plot_trending_players(lookback_hours = 24, limit = 10, tick_color = "white")
## Not run: plot_trending_players(lookback_hours = 24, limit = 10) ## Not run: plot_trending_players(lookback_hours = 24, limit = 10, tick_color = "white")
Given the number of hours to look back, and a limit of how many players to return, display a figure showing the top additions and drops in a table.
plot_trending_players_table( lookback_hours = 24, limit = 10, font_color = "inherit", drop_fill = "#f68383", add_fill = "lightgreen" )
plot_trending_players_table( lookback_hours = 24, limit = 10, font_color = "inherit", drop_fill = "#f68383", add_fill = "lightgreen" )
lookback_hours |
Number of hours to look back (numeric). |
limit |
Number of players returned for add/drop. Should be less than 50 (numeric). |
font_color |
Font color, name or hex (string). |
drop_fill |
Bar color, name or hex, for drops (string). |
add_fill |
Bar color, name or hex, for adds (string). |
Returns a plot containing information (name and count) about the trending NFL players.
Nick Bultman, [email protected], February 2024
## Not run: plot_trending_players_table(lookback_hours = 24, limit = 10) ## Not run: plot_trending_players_table(lookback_hours = 24, limit = 10, font_color = "white")
## Not run: plot_trending_players_table(lookback_hours = 24, limit = 10) ## Not run: plot_trending_players_table(lookback_hours = 24, limit = 10, font_color = "white")
Given the league ID and display name, plot the current total fantasy points against that user while also plotting the current total fantasy points against the rest of the league in a different color (assuming the colors are not set to the same by the user).
plot_user_fantasy_points_against( league_id, display_name, title = "<b>Total Fantasy Points Against by User</b>", tick_color = "black", user_fill = "#f68383", other_fill = "lightgrey" )
plot_user_fantasy_points_against( league_id, display_name, title = "<b>Total Fantasy Points Against by User</b>", tick_color = "black", user_fill = "#f68383", other_fill = "lightgrey" )
league_id |
League ID assigned by Sleeper (numeric). |
display_name |
Display name created by user (string). |
title |
Title for plot, which can include HTML formatting (string). |
tick_color |
Font color, name or hex, for display names (string). |
user_fill |
Bar color, name or hex, for display name specified (string). |
other_fill |
Bar color, name or hex, for other display names (string). |
Returns a plot containing the total fantasy points against by user.
Nick Bultman, [email protected], March 2024
## Not run: plot_user_fantasy_points_against(688281863499907072, "njbultman74")
## Not run: plot_user_fantasy_points_against(688281863499907072, "njbultman74")
Given the league ID and display name, plot the current total fantasy points for, against, and differential between the two together in one bar chart.
plot_user_fantasy_points_differential( league_id, display_name, title = paste0("<b>Fantasy Point Differential: ", display_name, "</b>"), tick_color = "black", fill_points_for = "lightgreen", fill_points_against = "#f68383" )
plot_user_fantasy_points_differential( league_id, display_name, title = paste0("<b>Fantasy Point Differential: ", display_name, "</b>"), tick_color = "black", fill_points_for = "lightgreen", fill_points_against = "#f68383" )
league_id |
League ID assigned by Sleeper (numeric). |
display_name |
Display name created by user (string). |
title |
Title for plot, which can include HTML formatting (string). |
tick_color |
Font color, name or hex, for display names (string). |
fill_points_for |
Bar color, name or hex, for bar containing fantasy points for (string). |
fill_points_against |
Bar color, name or hex, for bar containing fantasy points against (string). |
Returns a plot containing the total fantasy points differential by user.
Nick Bultman, [email protected], March 2024
## Not run: plot_user_fantasy_points_differential(688281863499907072, "njbultman74")
## Not run: plot_user_fantasy_points_differential(688281863499907072, "njbultman74")
Given the league ID and display name, plot the current total fantasy points for that user while also plotting the current total fantasy points for the rest of the league, with the specified user's bar colored in a different color than the others (assuming the colors are not set to the same by the user).
plot_user_fantasy_points_for( league_id, display_name, title = "<b>Total Fantasy Points For by User</b>", tick_color = "black", user_fill = "#f68383", other_fill = "lightgrey" )
plot_user_fantasy_points_for( league_id, display_name, title = "<b>Total Fantasy Points For by User</b>", tick_color = "black", user_fill = "#f68383", other_fill = "lightgrey" )
league_id |
League ID assigned by Sleeper (numeric). |
display_name |
Display name created by user (string). |
title |
Title for plot, which can include HTML formatting (string). |
tick_color |
Font color, name or hex, for display names (string). |
user_fill |
Bar color, name or hex, for display name specified (string). |
other_fill |
Bar color, name or hex, for other display names (string). |
Returns a plot containing the total fantasy points for by user.
Nick Bultman, [email protected], March 2024
## Not run: plot_user_fantasy_points_for(688281863499907072, "njbultman74")
## Not run: plot_user_fantasy_points_for(688281863499907072, "njbultman74")
Given the league ID and display name, plot the current waiver budget for the user (meaning total waiver budget available versus how much the user has remaining).
plot_user_waiver_budget( league_id, display_name, title = "<b> Waiver Budget</b>", tick_color = "black", budget_total_line_color = "black", fill_color = "lightgreen" )
plot_user_waiver_budget( league_id, display_name, title = "<b> Waiver Budget</b>", tick_color = "black", budget_total_line_color = "black", fill_color = "lightgreen" )
league_id |
League ID assigned by Sleeper (numeric). |
display_name |
Display name created by user (string). |
title |
Title for plot, which can include HTML formatting (string). |
tick_color |
Font color, name or hex, for display names (string). |
budget_total_line_color |
Line color for max budget, name or hex (string). |
fill_color |
Fill color for bar, name or hex (string). |
Returns a plot containing the waiver budget status.
Nick Bultman, [email protected], January 2024
## Not run: plot_user_waiver_budget(688281863499907072, "njbultman74")
## Not run: plot_user_waiver_budget(688281863499907072, "njbultman74")
Given the league ID and display name, plot the total points scored by week for the display name and colored by whether the result was a win or a loss. The x-axis labels show the opposing display name for that specific week.
plot_user_weekly_matchups( league_id, display_name, title = paste0("<b>", display_name, ": Weekly Matchups, Filled by Win/Loss</b>"), tick_color = "inherit", win_fill = "lightgreen", lose_fill = "#f68383" )
plot_user_weekly_matchups( league_id, display_name, title = paste0("<b>", display_name, ": Weekly Matchups, Filled by Win/Loss</b>"), tick_color = "inherit", win_fill = "lightgreen", lose_fill = "#f68383" )
league_id |
League ID assigned by Sleeper (numeric). |
display_name |
Display name created by user (string). |
title |
Title for plot, which can include HTML formatting (string). |
tick_color |
Font color, name or hex, for weeks (string). |
win_fill |
Fill color, name or hex, for wins (string). |
lose_fill |
Fill color, name or hex, for losses (string). |
Returns a plot containing the display name's weekly matchups.
Nick Bultman, [email protected], May 2024
## Not run: plot_user_weekly_matchups(688281863499907072, "datcommish")
## Not run: plot_user_weekly_matchups(688281863499907072, "datcommish")
Given the league ID and display name, plot the total points scored by week for each player ever associated with the display name.
plot_user_weekly_players( league_id, display_name, title = paste0("<b>", display_name, ": Player Points by Week</b>"), tick_color = "inherit" )
plot_user_weekly_players( league_id, display_name, title = paste0("<b>", display_name, ": Player Points by Week</b>"), tick_color = "inherit" )
league_id |
League ID assigned by Sleeper (numeric). |
display_name |
Display name created by user (string). |
title |
Title for plot, which can include HTML formatting (string). |
tick_color |
Font color, name or hex, for players (string). |
Returns a plot containing the display name's weekly players and their respective points for each week.
Nick Bultman, [email protected], May 2024
## Not run: plot_user_weekly_players(688281863499907072, "datcommish")
## Not run: plot_user_weekly_players(688281863499907072, "datcommish")