You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing in a season number only returns scoreboard for spring games (1/1/{season} onwards)
You can return fall games by passing in a specific date (e.g., `"20231108"), but this fails for the 2002 season
# only returns data for Jan 1 of the calendar year onwardsseason_scores<-hoopR::espn_mbb_scoreboard(2024)
min(season_scores$game_date)
#> [1] "2024-01-01"
# can get fall games by passing in specific dates as a stringday_scores<-hoopR::espn_mbb_scoreboard("20231108")
unique(day_scores$game_date)
#> [1] "2023-11-08"
# this workaround errors out for the 2002 season!day_scores_2002<-hoopR::espn_mbb_scoreboard("20011108")
#> Error in max_year + 1: non-numeric argument to binary operator
max_year<- substr(Sys.Date(), 1, 4)
if (!(as.integer(substr(season, 1, 4)) >2001)) {
message(paste("Error: Season must be between 2001 and",
max_year+1))
}
I'm not sure if my workaround of passing in a specific day as a string is expected user behavior. If it is, I can fork / fix the 2002 season issue directly. If not, it may be beneficial to enforce that season is an integer between 2002/current season as well as fixing the spring-only return. I suspect that the same behavior is also present in the wehoop package.
I have a local workaround to the workaround in the meantime --- thanks for the package in general, this is great!
The text was updated successfully, but these errors were encountered:
Found a couple bugs with
espn_mbb_scoreboard()
:Created on 2024-10-17 with reprex v2.1.0
In the function internals, this causes the issue:
max_year
is cast to a characterI'm not sure if my workaround of passing in a specific day as a string is expected user behavior. If it is, I can fork / fix the 2002 season issue directly. If not, it may be beneficial to enforce that
season
is an integer between 2002/current season as well as fixing the spring-only return. I suspect that the same behavior is also present in the wehoop package.I have a local workaround to the workaround in the meantime --- thanks for the package in general, this is great!
The text was updated successfully, but these errors were encountered: