The Richmond Red Zone

[This article was first published on Analysis of AFL, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

So watching footyclassified and Matthew Lloyd made a comment that it would seem as though the key to beating Richmond is controlling the ball via having more kicks to handballs.

Got me thinking, wouldn’t that be cool if a plot showed the same insight that an industry professional had?

Well lets do that plot!

library(fitzRoy)
library(tidyverse)
## -- Attaching packages ------------------
## v ggplot2 3.0.0.9000     v purrr   0.2.5     
## v tibble  1.4.2          v dplyr   0.7.6     
## v tidyr   0.8.1          v stringr 1.3.1     
## v readr   1.1.1          v forcats 0.3.0
## -- Conflicts -- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
df<-fitzRoy::get_footywire_stats(9514:9657)
## Getting data from footywire.com
## Finished getting data
 df%>%
   select(Round, Team, Opposition, K, HB)%>%
   filter(Opposition=="Richmond")%>%
   group_by(Round, Team, Opposition)%>%
   summarise(kicks=sum(K),
             handballs=sum(HB))%>%
     ggplot(aes(x=kicks, y=handballs, label=Round))+geom_point()+
   geom_text(position=position_jitter(height=3))  +
   geom_curve(aes(x = 220, y = 120, xend = 260, yend = 200, colour = "curve"), curvature = -.35)+
   theme(legend.position="none") +
   ggtitle("Richmond Oppositions Kicks and Handball Totals")+
   ylab("Richmond Handballs Conceded") + xlab("Richmond Kicks conceded")

The interesting thing about this plot is that if you look at the red line, all games to the right of it Richmond have lost?

Was Lloydy onto something?

Hopefully now you have a template and hopefully you are a little bit keener on using it to derive your own non Lloydy insights. Give it a go, its suprisingly addictive….

As always, got any questions, hit me up on twitter using the #makemeauseR or feel free to email.

To leave a comment for the author, please follow the link and comment on their blog: Analysis of AFL.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)