eoppe1022 / elite

A Package for Scraping Hockey Data from EliteProspects
32 stars 14 forks source link

issue in get_player_stats_individual #3

Closed gregalytics closed 5 years ago

gregalytics commented 5 years ago

Got error with get_player_stats_individual on a large amount of junior players (24d projected run). I think it has to do with missing player info or stats.

Temporarily, is there a purrr function that would let me run this and ignore the error?

get_player_stats_individual() [>----------------------------------------------] 2% ETA: 24dError in if (stringr::strdetect(vitals[["position"]], "G")) { : missing value where TRUE/FALSE needed

Thanks again.

eoppe1022 commented 5 years ago

That's strange because I changed my function a while back so that there is no part of the function that contains that code. Can you try re-installing? devtools::install_github("eoppe1022/elite", force = TRUE)

gregalytics commented 5 years ago

The new error handling is great! That said, the entire process runs then fails with an "Argument must be length __, not ___" error.

get_player_stats_individual() [==============================================>] 100% ETA: 4mError: Argument 2 must be length 9996, not 10000

Riskworks commented 5 years ago

I can reproduce this error with a single player

Just run the first part

statsMarrimack2015 <- get_player_stats_team(teams) %>% filter(team == "Merrimack College")

Pantano <- subset(statsMarrimack2015, name == "Craig Pantano") & position == "G") get_player_stats_individual(Pantano)

which generates this error: Here's where it's from:

Player URL: https://www.eliteprospects.com/player/203365/craig-pantano Name: Craig Pantano Error: Argument 2 must be length 0, not 1 Thx.