(Experimental!) This function reads your league's ff_scoring rules and maps them to nflfastr week-level data. Not all of the scoring rules from your league may have nflfastr equivalents, but most of the common ones are available!

ff_scoringhistory(conn, season, ...)

# S3 method for espn_conn
ff_scoringhistory(conn, season = 1999:2020, ...)

# S3 method for flea_conn
ff_scoringhistory(conn, season = 1999:2020, ...)

# S3 method for mfl_conn
ff_scoringhistory(conn, season = 1999:2020, ...)

# S3 method for sleeper_conn
ff_scoringhistory(conn, season = 1999:2020, ...)

Arguments

conn

a conn object created by ff_connect()

season

season a numeric vector of seasons (earliest available year is 1999)

...

other arguments

Value

A tidy dataframe of weekly fantasy scoring data, one row per player per week

Methods (by class)

  • espn_conn: ESPN: returns scoring history in a flat table, one row per player per week.

  • flea_conn: Fleaflicker: returns scoring history in a flat table, one row per player per week.

  • mfl_conn: MFL: returns scoring history in a flat table, one row per player per week.

  • sleeper_conn: Sleeper: returns scoring history in a flat table, one row per player per week.

See also

Examples

# \donttest{ conn <- espn_connect(season = 2020, league_id = 899513) ff_scoringhistory(conn)
#> # A tibble: 112,291 x 24 #> season week gsis_id sportradar_id espn_id player_name pos team points #> <dbl> <int> <chr> <chr> <int> <chr> <chr> <chr> <dbl> #> 1 1999 1 00-0000003 NA NA A.al-Jabbar RB MIA 13.2 #> 2 1999 2 00-0000003 NA NA A.al-Jabbar RB MIA 6.6 #> 3 1999 4 00-0000003 NA NA A.al-Jabbar RB MIA 0.2 #> 4 1999 7 00-0000003 NA NA A.al-Jabbar RB CLE 4.5 #> 5 1999 8 00-0000003 NA NA A.al-Jabbar RB CLE 3.9 #> 6 1999 9 00-0000003 NA NA A.al-Jabbar RB CLE 3 #> 7 1999 10 00-0000003 NA NA A.al-Jabbar RB CLE 6.6 #> 8 1999 11 00-0000003 NA NA A.al-Jabbar RB CLE 2.3 #> 9 1999 12 00-0000003 NA NA A.al-Jabbar RB CLE 4.1 #> 10 1999 13 00-0000003 NA NA A.al-Jabbar RB CLE 5.5 #> # … with 112,281 more rows, and 15 more variables: passing_yards <dbl>, #> # passing_tds <dbl>, interceptions <dbl>, sack_fumbles_lost <dbl>, #> # passing_2pt_conversions <dbl>, rushing_yards <dbl>, rushing_tds <dbl>, #> # rushing_fumbles_lost <dbl>, rushing_2pt_conversions <dbl>, #> # receptions <dbl>, receiving_yards <dbl>, receiving_tds <dbl>, #> # receiving_fumbles_lost <dbl>, receiving_2pt_conversions <dbl>, #> # special_teams_tds <dbl>
# } # \donttest{ # conn <- fleaflicker_connect(2020, 312861) ff_scoringhistory(conn, season = 2020)
#> # A tibble: 5,423 x 24 #> season week gsis_id sportradar_id espn_id player_name pos team points #> <dbl> <int> <chr> <chr> <int> <chr> <chr> <chr> <dbl> #> 1 2020 1 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 20.5 #> 2 2020 2 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 8.68 #> 3 2020 3 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 23.9 #> 4 2020 4 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 32.5 #> 5 2020 5 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 14.1 #> 6 2020 6 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 14.6 #> 7 2020 7 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 36.9 #> 8 2020 8 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 19.1 #> 9 2020 9 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 2.36 #> 10 2020 10 00-0019… 41c44740-d0f6-4… 2330 T.Brady QB TB 31.8 #> # … with 5,413 more rows, and 15 more variables: passing_yards <dbl>, #> # passing_tds <dbl>, interceptions <dbl>, sack_fumbles_lost <dbl>, #> # passing_2pt_conversions <dbl>, rushing_yards <dbl>, rushing_tds <dbl>, #> # rushing_fumbles_lost <dbl>, rushing_2pt_conversions <dbl>, #> # receptions <dbl>, receiving_yards <dbl>, receiving_tds <dbl>, #> # receiving_fumbles_lost <dbl>, receiving_2pt_conversions <dbl>, #> # special_teams_tds <dbl>
# } # \donttest{ # ssb_conn <- ff_connect(platform = "mfl", league_id = 54040, season = 2020) # ff_scoringhistory(ssb_conn) # } # \donttest{ #' # conn <- ff_connect(platform = "sleeper", league_id = "522458773317046272", season = 2020) # ff_scoringhistory(conn, season = 2020) # }