Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understat match stats and players #386

Merged
merged 17 commits into from
Jul 9, 2024
Merged

Understat match stats and players #386

merged 17 commits into from
Jul 9, 2024

Conversation

jruizcabrejos
Copy link
Contributor

Currently, understat_match data only retrieves shots data.

This 2 functions should retrieve both the Stats table and the player data for each match.

Copy link
Collaborator

@tonyelhabr tonyelhabr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me, and I'll be happy to approve when my feedback is addressed. Oh, and one other thing not mentioned in in-line comments--please add tests for each function in tests/testthat/test-understat.R.

This is a great first pass! I'm really happy to see your contribution.

R/understat_match_players.R Show resolved Hide resolved
R/understat_match_players.R Outdated Show resolved Hide resolved
R/understat_match_players.R Outdated Show resolved Hide resolved
R/understat_match_stats.R Outdated Show resolved Hide resolved
@jruizcabrejos
Copy link
Contributor Author

Great! I have addressed all the comments in the review (namespaces, indentation, and variable coercion). Added the tests for both functions and updated some of the documentation.

For understat_match_stats it is further explained a limitation for the variable "chances". For example, in the next screenshot (match 22275) the 2% is being retrieved as an empty character "". These empty values are being set to NA.

The 90% does return correctly (and it is being processed into a 0.9 in the final output)

image

@tonyelhabr
Copy link
Collaborator

Great! I have addressed all the comments in the review (namespaces, indentation, and variable coercion). Added the tests for both functions and updated some of the documentation.

For understat_match_stats it is further explained a limitation for the variable "chances". For example, in the next screenshot (match 22275) the 2% is being retrieved as an empty character "". These empty values are being set to NA.

The 90% does return correctly (and it is being processed into a 0.9 in the final output)

image

thanks for the clarification. that seems fine to me 👍

@tonyelhabr
Copy link
Collaborator

i just pushed some final touch-ups. testing in Github Actions now. some transfermarket tests may fail, but we should see the understat tests pass

#'
#' @export

understat_match_players <- function(match_url) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only new feedback on this is that there might have been a cleaner way of doing all of this. i noticed that {understatr} seems to have a more straightforward approach, although i haven't thoroughly checked the details. it could be the same exact implementation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but i don't think this function should be changed at this point

@JaseZiv
Copy link
Owner

JaseZiv commented Jul 9, 2024

Thanks for the contribution @jruizcabrejos!

Thanks also for the work reviewing @tonyelhabr!

@JaseZiv JaseZiv merged commit 5de8e32 into JaseZiv:main Jul 9, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants