The ffpros package has several configuration options, most of which control default behaviours for functions.
This option controls caching of requests, and is the only option that needs to be set before the package is loaded.
The available options are
"filesystem" (persistent between R sessions), and
Pages are stored for one (1) hour.
You can use
usethis::edit_r_profile() to include this option in your R profile, which will automatically load before the ffpros package in future sessions.
The default sport for all ffpros functions is NFL. To change this, you can set the ffpros.sport option, which needs to be one of
You can also use the
fp_set_sport() function to accomplish the same thing:
You should not set this option in your rprofile, since it materially changes how ffpros operates - functions will start returning different output by default. Instead, always set it at the top of any required script.
By default, ffpros functions return only the cleaned data, but it can be configured to return the page HTML as well as any additional metadata, in case you want to parse the page on your own.
This can be set with either of the following two methods:
This function, as with the sport option, changes how ffpros functions behave in a material way - so you should not set this option in your rprofile. Instead, always set it at the top of any required script.
ffpros will default to identifying itself to FantasyPros.com as
"ffpros R client package https://github.com/ffverse/ffpros". If you would like to pass a different user agent, you can configure this with either of the following two methods:
There’s no significant difference between either of these methods and you can set it in your rprofile if you wish.