jimmyday12 / fitzRoy

A set of functions to easily access AFL data
https://jimmyday12.github.io/fitzRoy
Other
129 stars 27 forks source link

2021 AFL Tables Function Error #151

Closed petebish07 closed 3 years ago

petebish07 commented 3 years ago

Hi, I'm getting the following error when trying to use the fetch_player_stats_afltables function on the 2021 season, other seasons appear to be fine.

Below is rundown, hopefully everything you need is there.

Also, thanks for creating and maintaining this package, it's unreal.

Test <- fetch_player_stats_afltables(season = 2021) i Looking for data from 2021-01-01 to 2021-03-23 v fetching cached data from ... done i New data found for 9 matches v Downloading data ... done i Processing XMLSError: Can't combine Round and Round . Run rlang::last_error() to see where the error occurred. x Processing XMLS ... failed

rlang::last_error() <error/vctrs_error_incompatible_type> Can't combine Round and Round . Backtrace:

  1. fitzRoy::fetch_player_stats_afltables(season = 2021)
  2. purrr::map2_dfr(., .y = start:end, ~dplyr::mutate(., Season = .y))
  3. dplyr::bind_rows(res, .id = .id)
  4. vctrs::vec_rbind(!!!dots, .names_to = .id)
  5. vctrs::vec_default_ptype2(...)
  6. vctrs:::vec_ptype2_df_fallback(x, y, opts)
  7. vctrs:::vec_ptype2_params(...)
  8. vctrs:::vec_ptype2_opts(x, y, opts = opts, x_arg = x_arg, y_arg = y_arg)
  9. vctrs::vec_default_ptype2(...)
  10. vctrs::stop_incompatible_type(...)
  11. vctrs:::stop_incompatible(...)
  12. vctrs:::stop_vctrs(...) Run rlang::last_trace() to see the full context. rlang::last_trace() <error/vctrs_error_incompatible_type> Can't combine Round and Round . Backtrace: x
  13. +-fitzRoy::fetch_player_stats_afltables(season = 2021)
  14. | -fitzRoy:::scrape_afltables_match(urls)
  15. | -fitzRoy:::get_afltables_player_ids(min(games_cleaned$Season):max(games_cleaned$Season))
  16. | -%>%(...)
  17. -purrr::map2_dfr(., .y = start:end, ~dplyr::mutate(., Season = .y))
  18. -dplyr::bind_rows(res, .id = .id)
  19. -vctrs::vec_rbind(!!!dots, .names_to = .id)
  20. -(function () ...
  21. -vctrs::vec_default_ptype2(...)
  22. -vctrs:::vec_ptype2_df_fallback(x, y, opts)
  23. -vctrs:::vec_ptype2_params(...)
  24. -vctrs:::vec_ptype2_opts(x, y, opts = opts, x_arg = x_arg, y_arg = y_arg)
  25. -(function () ...
  26. -vctrs::vec_default_ptype2(...)
  27. -vctrs::stop_incompatible_type(...)
  28. -vctrs:::stop_incompatible(...)
  29. -vctrs:::stop_vctrs(...)
jimmyday12 commented 3 years ago

Thanks for the info.

I have a feeling this may have been fixed by a recent PR - https://github.com/jimmyday12/fitzRoy/commit/8767ccb46116e91b81cbf0e001ffb8488eb1194a

It sounds similar to this issue which is now closed - https://github.com/jimmyday12/fitzRoy/issues/149

You'll have to reinstall the package with the dev version devtools::install_github("jimmyday12/fitzRoy")

Let me know if that fixes the problem!

petebish07 commented 3 years ago

Yep, that solved it. Thanks for replying so quick

jimmyday12 commented 3 years ago

Fixed by https://github.com/jimmyday12/fitzRoy/commit/8767ccb46116e91b81cbf0e001ffb8488eb1194a