keberwein / mlbgameday

Multi-core processing of 'Gameday' data from Major League Baseball Advanced Media. Additional tools to parallelize large data sets and write them to a database.
Other
41 stars 8 forks source link

Get_Payload #10

Closed Djgamelin closed 5 years ago

Djgamelin commented 6 years ago

There appears to be an issue pulling data <= 2014. Below are two examples of error messages returned when trying to pull data.

Events_14 <- get_payload(start = "2014-04-04", end = "2014-04-05", dataset = "inning_all") Gathering Gameday data, please be patient... Error: tfs_zulu = NULL must be a column name or position, not NULL

Events_10 <- get_payload(start = "2010-04-04", end = "2010-04-05", dataset = "inning_all") Gathering Gameday data, please be patient... Error: tfs_zulu = NULL must be a column name or position, not NULL

keberwein commented 6 years ago

Should be fixed now. You'll have to update the package with: devtools::install_github("keberwein/mlbgameday", force = TRUE)

The column for num (atbat number) was calculated using end_tfs_zulu from the atbat table and tfs_zulu from the action table. Apparently end_tfs_zulu is absent for certain years. I changed the calculation to use start_tfs_zulu. I still need to do more testing on this, but the above example seems to be working fine.

https://github.com/keberwein/mlbgameday/commit/450deebf99f9db0de3fc79bb8f58286ceec98410