jimmyday12 / fitzRoy

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

Can't combine `Round` <character> and `Round` <double> While Processing xml from "get_afltables_stats" #154

Closed nandania-sportsbet closed 3 years ago

nandania-sportsbet commented 3 years ago

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’: filter, lag The following objects are masked from ‘package:base’: intersect, setdiff, setequal, union Started Execution Fetching stats ℹ Looking for data from 2021-01-01 to 2021-04-12 ℹ fetching cached data from ✔ fetching cached data from ... done ℹ New data found for 9 matches ℹ Downloading data ✔ Downloading data ... done ℹ Processing XMLS _Error: Can't combine Round and Round . Error: Can't combine Round character and Round double Backtrace: █

  1. ├─base::source("/home/rstudio/StatsTransformer.R")
  2. │ ├─base::withVisible(eval(ei, envir))
  3. │ └─base::eval(ei, envir)
  4. │ └─base::eval(ei, envir)
  5. ├─fitzRoy::get_afltables_stats(start_date = startDate, end_date = today)
  6. │ └─fitzRoy::fetch_player_stats_afltables(season = seasons)
  7. │ └─fitzRoy:::scrape_afltables_match(urls)
  8. │ └─fitzRoy:::get_afltables_player_ids(min(games_cleaned$Season):max(games_cleaned$Season))
  9. │ └─%>%(...)
  10. └─purrr::map2_dfr(., .y = start:end, ~dplyr::mutate(., Season = .y))
  11. └─dplyr::bind_rows(res, .id = .id)
  12. └─vctrs::vec_rbind(!!!dots, .names_to = .id)
  13. └─(function () ...
  14. └─vctrs::vec_default_ptype2(...)
  15. └─vctrs:::vec_ptype2_df_fallback(x, y, opts)
  16. └─vctrs:::vec_ptype2_params(...)
  17. └─vctrs:::vec_ptype2_opts(x, y, opts = opts, x_arg = x_arg, y_arg = y_arg)
  18. └─(function () ...
  19. └─vctrs::vec_default_ptype2(...)
  20. └─vctrs::stop_incompatible_type(...)
  21. └─vctrs:::stop_incompatible(...)
  22. └─vctrs:::stop_vctrs(...) Warning message: 'get_afltables_stats' is deprecated. Use 'fetch_player_stats_afltables' instead. See help("Deprecated") ✖ Processing XMLS ... failed Execution halted
nandania-sportsbet commented 3 years ago

@jimmyday12 Can you please suggest on it. Is it something in library not working ?

jimmyday12 commented 3 years ago

Firstly - as the message indicates you should use fetch_player_stats_afltables instead of get_afltables_stats. Regardless, can you please provide a reproducible example? At the moment I'm not exactly sure what code you are running to produce the error you have pasted. If I simply run the get_afltables_stats I don't get an error.

This could give some tips on how to create a reproducible example ("reprex") - https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html

This package is also really helpful https://github.com/tidyverse/reprex. You just copy the code that is breaking and then run reprex::reprex() and it will copy everything for you to paste here.

nandania-sportsbet commented 3 years ago

thanks @jimmyday12 for quick response. Fix for this issue is in main branch https://github.com/jimmyday12/fitzRoy/commit/6c1054fff39271b011b4a4564f7078999b0c8e3d