Helps scrape FantasyPros.com by handling rate-limiting/caching/parsing and returning tidy dataframes which can be easily connected to other data sources.

Renamed from fpscrapr to ffpros on 2021-06-14 so that all ffverse packages start with ff

Installation

Install the stable version of this package from the ffverse r-universe repository:

install.packages("ffpros", repos = "https://ffverse.r-universe.dev")

Install the development version with either DynastyProcess’s r-universe or remotes + GitHub:

# ffverse's r-universe
install.packages("ffpros", repos = "https://dynastyprocess.r-universe.dev")

# or via GitHub c/o remotes/devtools: # install.packages('remotes')
remotes::install_github("dynastyprocess/ffpros")

Usage

All ffpros functions start with fp_ for ease of autocomplete.

The fp_rankings function retrieves fantasy ranks from FantasyPros.com.

library(ffpros)

fp_rankings(page = "consensus-cheatsheets") # defaults to nfl!
#> # A tibble: 495 x 27
#>   fantasypros_id player_name         pos   team   rank   ecr    sd  best worst
#>            <int> <chr>               <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1          16393 Christian McCaffrey RB    CAR       1  1.2   0.72     1     6
#> 2          16374 Dalvin Cook         RB    MIN       2  2.2   0.57     1     4
#> 3          15514 Derrick Henry       RB    TEN       3  2.99  0.63     1     7
#> 4          17240 Saquon Barkley      RB    NYG       4  5.35  2.24     2    22
#> 5          17246 Nick Chubb          RB    CLE       5  6.35  2.33     3    20
#> # ... with 490 more rows, and 18 more variables: sportradar_id <chr>,
#> #   yahoo_id <chr>, cbs_id <chr>, player_positions <chr>,
#> #   player_short_name <chr>, player_eligibility <chr>,
#> #   player_yahoo_positions <chr>, player_page_url <chr>, player_filename <chr>,
#> #   player_square_image_url <chr>, player_image_url <chr>,
#> #   player_bye_week <chr>, player_owned_avg <dbl>, player_owned_espn <dbl>,
#> #   player_owned_yahoo <int>, player_ecr_delta <int>, pos_rank <chr>,
#> #   tier <int>

fp_rankings(page = "ros-overall", sport = "nhl")
#> # A tibble: 420 x 9
#>   fantasypros_id player_name     team  pos    rank   ecr    sd  best worst
#>   <chr>          <chr>           <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 16664          Connor McDavid  EDM   C,F       1   1.5   0.5     1     2
#> 2 17201          Auston Matthews TOR   C,F       2   2.5   1.5     1     4
#> 3 16669          Mitchell Marner TOR   RW,F      3   8.5   5.5     3    14
#> 4 16588          Leon Draisaitl  EDM   C,LW      4  10     7       3    17
#> 5 15373          Patrick Kane    CHI   RW,F      5  12     1      11    13
#> # ... with 415 more rows

Default configuration options are detailed in the configuration options vignette.

Support

The best places to get help on this package are:

Contributing

Many hands make light work! Here are some ways you can contribute to this project:

Terms of Use

The R code for this package is released as open source under the MIT license.

The data accessed by this package belongs to FantasyPros.com, and is governed by their terms of use.