Package 'ffpros'

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-09-20 04:41:29 UTC
Source: https://github.com/ffverse/ffpros

Help Index


Import FantasyPros Projections

Description

Scrapes FantasyPros ranks from the specified page (and optionally, returns metadata).

Usage

fp_projections(page, ..., sport = NULL, include_metadata = NULL)

Arguments

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

See Also

https://github.com/dynastyprocess/data

https://www.fantasypros.com

Examples

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")
}

Import latest FantasyPros Rankings

Description

Scrapes FantasyPros ranks from the specified page (and optionally, returns metadata).

Usage

fp_rankings(page, ..., sport = NULL, include_metadata = NULL)

Arguments

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

See Also

https://github.com/dynastyprocess/data

https://www.fantasypros.com

Examples

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")
}

Set whether metadata is returned

Description

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)

Usage

fp_set_metadata(include = FALSE)

Arguments

include

logical


Set rate limit

Description

A helper function that adjusts rate limits for ffpros.

Usage

fp_set_ratelimit(rate_number = 1, rate_seconds = 5, rate_limit = TRUE)

Arguments

rate_number

number of calls per rate_seconds

rate_seconds

number of seconds

rate_limit

a logical to turn rate limiting on if TRUE and off if FALSE


Set default sport

Description

A helper function that sets the default sport for the ffpros functions. Can be overridden directly.

Usage

fp_set_sport(sport)

Arguments

sport

one of c("nfl","nba","nhl","mlb")


Set user agent

Description

Configures the user agent for the ffpros scraping function.

Usage

fp_set_useragent(user_agent)

Arguments

user_agent

A character string to use as the user agent