jflancer / bigballR

Package for working with NCAA Basketball Data
Other
61 stars 19 forks source link

get_date_games returns Error in data.frame(Date = substr(game_date, 1, 10), Start_Time = substr(game_date, : arguments imply differing number of rows: 5, 1, 0 for old games #16

Closed jedwards757 closed 3 years ago

jedwards757 commented 3 years ago

Haven't exhaustively gone through each date to see what specific dates it errors out on, but appears to work fine with newer dates and doesn't work for older dates. Example:

library(bigballR) get_date_games(date = '02/26/2011',conference = 'ACC') 02/26/2011 | 5 games found Error in data.frame(Date = substr(game_date, 1, 10), Start_Time = substr(game_date, : arguments imply differing number of rows: 5, 1, 0

Issue results from calling stringr::str_extract_all on the home_team string when the string does not contain W-L records and returns a character(0) instead of NA in get_date_games. Submitting a quick PR to fix this.

jflancer commented 3 years ago

Thanks for catching this and for putting in a PR. I'll merge in the fix