fetch_statcast: Fetch MLB statcast data.

View source: R/fetch.R

fetch_statcastR Documentation

Fetch MLB statcast data.

Description

This function queries Baseball Savant for statcast data on dates specified by dates and returns an R object with the results.

Usage

fetch_statcast(dates, verbose = TRUE)

Arguments

dates

The dates from which to retrieve statcast data

verbose

TRUE or FALSE: Whether or not to report messages.

Details

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.

Value

A statcast data.table

Examples

fetch_statcast("2017 April 12")
fetch_statcast("2019 Sept 4 to 2020")

devin-AK/statcastr documentation built on Nov. 18, 2022, 1:48 p.m.