Last active
September 8, 2021 03:07
-
-
Save tonyelhabr/120b573bf2f57951c603fca99889ae70 to your computer and use it in GitHub Desktop.
2021 ffsimulator predictions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ffscrapr) | |
library(ffsimulator) | |
library(ggplot2) | |
library(tonythemes) | |
conn <- espn_connect( | |
season = 2021, | |
league_id = 899513, | |
espn_s2 = Sys.getenv('FF_ESPN_S2'), | |
swid = Sys.getenv('FF_SWID') | |
) | |
conn | |
sim <- ff_simulate(conn = conn, n_seasons = 100, n_weeks = 14, seed = 42) | |
sim | |
autoplot(sim, type = 'wins') + theme_tony() + theme(legend.position = 'none') + labs(caption = NULL) | |
ggsave(filename = 'c:/users/aelhabr/desktop/ff_wins.png', width = 8, height = 8, type = 'cairo', dpi = 300) | |
autoplot(sim, type = 'rank') + theme_tony() + theme(legend.position = 'top', axis.text.x = element_blank(), panel.grid.major.x = element_blank()) + labs(caption = NULL) + guides(fill = guide_legend(''), color = 'none') | |
ggsave(filename = 'c:/users/aelhabr/desktop/ff_ranks.png', width = 12, height = 8, type = 'cairo', dpi = 300) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment