Title: | Retrieves Data from FantasyPros |
---|---|
Description: | Helps gather data from FantasyPros.com with rate-limiting/caching, forming appropriate calls, and returning tidy dataframes which can be easily connected to other data sources. |
Authors: | Tan Ho [aut, cre, cph] |
Maintainer: | Tan Ho <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.5 |
Built: | 2024-08-21 05:01:52 UTC |
Source: | https://github.com/ffverse/ffpros |
Scrapes FantasyPros ranks from the specified page (and optionally, returns metadata).
fp_projections(page, ..., sport = NULL, include_metadata = NULL)
fp_projections(page, ..., sport = NULL, include_metadata = NULL)
page |
which page |
... |
named arguments to pass as query parameters |
sport |
the sport to look up, defaults to nfl |
include_metadata |
logical - default FALSE (only return tibble), if TRUE returns list with both tibble and metadata |
https://github.com/dynastyprocess/data
if(interactive()){ fp_projections("qb") fp_projections("wr", year = 2016, week = 2, scoring = "PPR") fp_projections("flex", year = 2020, week = 7, scoring = "PPR", `min-yes`="true", `max-yes`="true") fp_projections("hitters", `min-yes` = "true", `max-yes` = "true", sport = "mlb") fp_projections("pitchers", sport = "mlb") fp_projections("overall", sport = "nba") }
if(interactive()){ fp_projections("qb") fp_projections("wr", year = 2016, week = 2, scoring = "PPR") fp_projections("flex", year = 2020, week = 7, scoring = "PPR", `min-yes`="true", `max-yes`="true") fp_projections("hitters", `min-yes` = "true", `max-yes` = "true", sport = "mlb") fp_projections("pitchers", sport = "mlb") fp_projections("overall", sport = "nba") }
Scrapes FantasyPros ranks from the specified page (and optionally, returns metadata).
fp_rankings(page, ..., sport = NULL, include_metadata = NULL)
fp_rankings(page, ..., sport = NULL, include_metadata = NULL)
page |
which page |
... |
named arguments to pass as query parameters |
sport |
the sport to look up, defaults to nfl |
include_metadata |
logical - default FALSE (only return tibble), if TRUE returns list with both tibble and metadata |
https://github.com/dynastyprocess/data
if(interactive()){ fp_rankings(page = "dynasty-overall") fp_rankings(page = "consensus-cheatsheets", year = 2017) fp_rankings(page = "overall", sport = "nba") fp_rankings(page = "ros-lw", sport = "nhl") fp_rankings(page = "nl-only-ros-overall", sport = "mlb") }
if(interactive()){ fp_rankings(page = "dynasty-overall") fp_rankings(page = "consensus-cheatsheets", year = 2017) fp_rankings(page = "overall", sport = "nba") fp_rankings(page = "ros-lw", sport = "nhl") fp_rankings(page = "nl-only-ros-overall", sport = "mlb") }
This option allows you to configure whether the output of functions includes metadata, or is simplified to only the dataframe. Defaults to simplifying (i.e. include = FALSE)
fp_set_metadata(include = FALSE)
fp_set_metadata(include = FALSE)
include |
logical |
A helper function that adjusts rate limits for ffpros.
fp_set_ratelimit(rate_number = 1, rate_seconds = 5, rate_limit = TRUE)
fp_set_ratelimit(rate_number = 1, rate_seconds = 5, rate_limit = TRUE)
rate_number |
number of calls per |
rate_seconds |
number of seconds |
rate_limit |
a logical to turn rate limiting on if TRUE and off if FALSE |
A helper function that sets the default sport for the ffpros functions. Can be overridden directly.
fp_set_sport(sport)
fp_set_sport(sport)
sport |
one of c("nfl","nba","nhl","mlb") |
Configures the user agent for the ffpros scraping function.
fp_set_useragent(user_agent)
fp_set_useragent(user_agent)
user_agent |
A character string to use as the user agent |