fetch_statcast | R Documentation |
This function queries Baseball Savant for statcast data on dates specified by dates
and returns an R object with the results.
fetch_statcast(dates, verbose = TRUE)
dates |
The dates from which to retrieve statcast data |
verbose |
TRUE or FALSE: Whether or not to report messages. |
The dates
argument is intended to be as flexible as possible. A single date of the form yyyy-mm-dd may be used: fetch_statcast("2017-03-20")
. To retrieve statcast data for an entire season, specify the year: fetch_statcast(2017)
. To select a range of dates, use the separator " to " as follows: fetch_statcast("2017 April 12 to 2017 April 20")
. To select specific dates, combine them in a character vector: fetch_statcast(c('2017 Apr 12','2018 April 12'))
. All of these modes can be used in conjunction, as long as year is listed first (then month, then day) within each individual date.
A statcast data.table
fetch_statcast("2017 April 12") fetch_statcast("2019 Sept 4 to 2020")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.