jflancer / bigballR

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

get_team_schedule_error #34

Closed dylangrafius closed 1 year ago

dylangrafius commented 1 year ago

Hello,

I like to use this package for all teams in division I, II, and III but I've noticed that sometimes the schedule function gives me this output:

Parsing Schedule Error in while (!substr(t[j], 1, i) %in% bigballR::teamids$Team && i <= : missing value where TRUE/FALSE needed

Is there anything that can be done to avoid this error in the future?

evanmiyakawa commented 1 year ago

Can you send some example code that led to this error?

dylangrafius commented 1 year ago

get_team_schedule(542947)

dylangrafius commented 1 year ago

I have about 40-50 other lines of code that give that same output if you want me to send those as well.

evanmiyakawa commented 1 year ago

Are you using the latest version of bigballR::teamids? 542947 is not an ID

dylangrafius commented 1 year ago

No, that’s a division II team ID from the NCAA website.

dylangrafius commented 1 year ago

And what's crazy is that the get_play_by_play function works for individual box scores. What I think may be the problem is these teams have games that are exhibition games. On their NCAA team pages it has this indicator at the bottom:

*Contest exempted and does not count toward season record or statistics for [INSERT TEAM] only.

Do you think there is any way around this?

dylangrafius commented 1 year ago

And you can even use that particular team ID to get the roster! So the issue is that the 50 teams (in D2) that have games that don't count messes up the schedule scraping and parsing function.

evanmiyakawa commented 1 year ago

I just pushed an update that should resolve this issue. Install the newest version:

devtools::install_github("jflancer/bigballR")

dylangrafius commented 1 year ago

Thank you!