/
load_game_info_sup.R
48 lines (46 loc) · 1.29 KB
/
load_game_info_sup.R
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#' @rdname load_game_info_sup
#' @title **Download a data frame of supplemental data about MLB games since 2008.**
#' @return Function returns a tibble with various columns, including:
#' * game_pk
#' * game_date
#' * venue id
#' * attendance
#' * game temperature
#' * wind speed
#' * direction
#' * start time
#' * end time
#' @export
#' @examples \donttest{
#' try(load_game_info_sup())
#' }
load_game_info_sup <- function() {
tryCatch(
expr = {
df <- csv_from_url("https://app.box.com/shared/static/qbtz8s1yxauamohcvrrjv2ba65v5p2d3.csv", encoding ="UTF-8")
df <- df %>%
make_baseballr_data("Supplementary MLB Game Info data from baseballr-data repository",Sys.time())
},
error = function(e) {
message(glue::glue("{Sys.time()}: Invalid arguments or no supplementary game info data available!"))
},
finally = {
}
)
return(df)
}
#' @rdname get_game_info_sup_petti
#' @title **(legacy) Download a data frame of supplemental data about MLB games since 2008.**
#' @return Function returns a tibble with various columns, including:
#' * game_pk
#' * game_date
#' * venue id
#' * attendance
#' * game temperature
#' * wind speed
#' * direction
#' * start time
#' * end time
#' @keywords legacy
#' @export
get_game_info_sup_petti <- load_game_info_sup