The Richmond Red Zone

July 16, 2018
By

(This article was first published on Analysis of AFL, and kindly contributed to R-bloggers)

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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

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)