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

nhl_game_feed() Pass a List of Game ID's to Load into One Dataframe #20

Open
ghost opened this issue Feb 17, 2022 · 1 comment
Open
Assignees

Comments

@ghost
Copy link

ghost commented Feb 17, 2022

I would like to load all plays from all games in a particular season from a single particular team (e.g. all plays from the Flyers 2021-2022 season).

Currently nhl_game_feed() only accepts a single game ID and loads a list of data frames (all plays, penalty plays, player box...etc.)

Is there a way to pass a list of game ID's and arguments specifying which data frames to load (i.e. just all plays or just penalty plays)?

Looping through a list of game ID's and calling nhl_game_feed() takes a lot of resources both from the loop and also loading extra data frames I am not interested in. Any way around this?

I also thought I could use load_nhl_pbp() and filter based on home or away team. Is there a way to get this information from the fields in the play by play data?

@saiemgilani
Copy link
Collaborator

saiemgilani commented Mar 24, 2022

Is there a way to pass a list of game ID's ..

Will not do this. There are a number of packages and functions which will allow you to iterate over a list with ease, purrr and furrr come to mind, or even a simple lapply will do.

..and arguments specifying which data frames to load (i.e. just all plays or just penalty plays)?

This... feels like a good idea that should be doable. No guarantees on immediate implementation.

I also thought I could use load_nhl_pbp() and filter based on home or away team. Is there a way to get this information from the fields in the play by play data?

Wow. My freaking bad. I am only now realizing the play by play does not include a lot of identifying information. Will work on that.

@saiemgilani saiemgilani self-assigned this Mar 24, 2022
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

No branches or pull requests

1 participant