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

Create a calculate_team_stats() function #342

Open
Josephhero opened this issue Jul 8, 2022 · 6 comments
Open

Create a calculate_team_stats() function #342

Josephhero opened this issue Jul 8, 2022 · 6 comments
Labels
Feature Request Offseason to-do Something to add when season is over

Comments

@Josephhero
Copy link

Can I request that a calculate_team_stats() function be created, similar to the calculate_player_stats() function, that would calculate the official nfl tallies for team yards, TDs, points per drive, etc.?

@tanho63 tanho63 added Feature Request Offseason to-do Something to add when season is over labels Jul 8, 2022
@mrcaseb
Copy link
Member

mrcaseb commented Jul 9, 2022

I am considering pfr for this. We could write scrapers for their team stats tables and put it all together in pfr_scrapR. What do you think @tanho63 and @guga31bb?

Some links:

@tanho63
Copy link
Member

tanho63 commented Jul 9, 2022

I’m curious whether that is better or whether we should develop a true parallel to player stats (ie build up from pbp)

@guga31bb
Copy link
Member

guga31bb commented Jul 9, 2022

Yeah if we do this, it should probably be with pbp so people can subset the data before doing it (which isn't possible if we just scraped PFR)

@mrcaseb
Copy link
Member

mrcaseb commented Jul 9, 2022

Yeah if we do this, it should probably be with pbp so people can subset the data before doing it (which isn't possible if we just scraped PFR)

I agree this has some value over PFR. We'd miss out some pfr specific data by going the nflfastR pbp route tho. But we could at least have our own model data and add series conversion rates.

@mrcaseb
Copy link
Member

mrcaseb commented Jul 9, 2022

I also wonder if we could go with this pseudo code

calculate_player_stats(weekly = TRUE) %>% summarise(team) %>% summarise(weeks if requested)

@tanho63
Copy link
Member

tanho63 commented Jul 9, 2022

hmm. if the target is the PFR standard offense tables I guess I don't see why not? We wouldn't have the series conversion rates though, nor redzone or drive averages by doing it that way.

I'm sure we could reuse a lot of the code that prepares player_stats though. Briefly wondering if it should be written in data.table to make go faster - likely to be processing whole seasons worth of pbp with this function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Offseason to-do Something to add when season is over
Projects
None yet
Development

No branches or pull requests

4 participants