Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all players' scoring, regardless if they are on a team or free agent #21

Closed
Chris-Whaley opened this issue Nov 25, 2020 · 6 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@Chris-Whaley
Copy link

The function team_roster() gets the scoring data for players on teams, but there is no function to get the projected and scoring data for players on the waiver wire. Could this be added?

@k5cents
Copy link
Owner

k5cents commented Nov 25, 2020

There's currently no way to show just waiver wire players, but the all_players() function has next_wk column for projections. You can filter out players from team_roster() using the unique ID to get waiver wire players.

The all_players() default row limits were changed a little in 0.3.13, so check the documentation for that.

library(tidyverse)
library(fflr)
rosters <- bind_rows(team_roster(lid = 252353))
all_players(limit = NULL) %>% 
  filter(is.na(match(id, rosters$id))) %>% 
  select(week, first, last, pro, pos, fpts, next_wk, this_szn)
#> # A tibble: 944 x 8
#>     week first    last          pro   pos    fpts next_wk this_szn
#>    <dbl> <chr>    <chr>         <fct> <fct> <dbl>   <dbl>    <dbl>
#>  1    12 Justin   Tucker        Bal   PK     97      7.78     97  
#>  2    12 Matt     Ryan          Atl   QB    178.    19.2     178. 
#>  3    12 DJ       Chark Jr.     Jax   WR     77.4    8.66     77.4
#>  4    12 Jamison  Crowder       NYJ   WR     60.5    6.96     60.5
#>  5    12 Harrison Butker        KC    PK     82      8.33     82  
#>  6    12 J.D.     McKissic      Wsh   RB     57.4    8.25     57.4
#>  7    12 Darrell  Henderson Jr. LAR   RB     92      7.48     92  
#>  8    12 Saints   D/ST          NO    DS     54.5    5.20     54.5
#>  9    12 Devin    Singletary    Buf   RB     64.8    6.63     64.8
#> 10    12 Nyheim   Hines         Ind   RB     85.5    7.68     85.5
#> # … with 934 more rows

Created on 2020-11-25 by the reprex package (v0.3.0)

@Chris-Whaley
Copy link
Author

Chris-Whaley commented Nov 25, 2020

Is there a way to get the fantasy points scored by player per week, regardless if they're rostered?

@k5cents
Copy link
Owner

k5cents commented Nov 25, 2020

I don't believe so, but that's definitely a feature that should be added. Poking around the API, I can only get it to return six stats for a given player. For example, Dalvin Cook's stats have these totals (on Wednesday, pre week 12):

  1. Last week = 20.00000
  2. Week before that = 11.20000
  3. This season (so far) = 216.30000
  4. Last season = 225.15700
  5. Next week = 20.55676
  6. Preseason projection = 239.40000

I'll have to poke around some more and see if there's an easy way to return all the weeks, like you would see on the website. The individual statistics and player history is the one big thing missing from this package (#16).

Screenshot_2020-11-25 Fantasy Football Team Clubhouse - ESPN

@k5cents
Copy link
Owner

k5cents commented Nov 25, 2020

One workaround for rostered players would be to use team_roster(week = 1) and just change the week.

@k5cents k5cents self-assigned this Nov 25, 2020
@k5cents k5cents added enhancement New feature or request bug Something isn't working labels Nov 25, 2020
@Chris-Whaley
Copy link
Author

Thanks for your efforts. I'm really enjoying using this.

@k5cents
Copy link
Owner

k5cents commented Oct 7, 2021

Only a year late, but the new list_players() function has all the functionality of the "Add Players" page on the ESPN website.

@k5cents k5cents closed this as completed Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants