Description Usage Arguments Examples
Get Gameday data from MLBAM.
1 2 |
start |
A start date passed as a character in ISO 8601 format. |
end |
An end date passed as a character in ISO 8601 format. |
league |
The league to gather gids for. The default is |
dataset |
The dataset to be scraped. The default is "inning_all." Other options include, "inning_hit", "linescore". |
game_ids |
A list of user-supplied gameIds. |
db_con |
A database connection from the |
overwrite |
Logical. Should current database be overwritten? Inherited from the |
... |
additional arguments |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
# Make a request for a single day.
df <- get_payload(start = "2016-06-01", end = "2016-06-01")
# Run larger requests in parallel.
library(doParallel)
library(foreach)
no_cores <- detectCores() - 2
cl <- makeCluster(no_cores)
registerDoParallel(cl)
df <- get_payload(start = "2016-01-01", end = "2017-01-01")
stopImplicitCluster()
rm(cl)
## End(Not run)
# Supply your own custom vector of game ids.
mygids <- search_gids(team = "indians", start = "2016-05-01", end = "2016-05-01")
df <- get_payload(game_ids = mygids)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.