I have been looking at the #AFLW 2019 data. I took the opportunity to include some CRAN packages I have not used before.
The data (two csv files) and my code are in a GitHub repository (link). My code is very basic and reflects my own thinking out loud as a I learn more about R.
In the past, I have tended to bookmark R suggestions and yet never manage to return to them as the list gets longer. My new practice is to create an R file to explore packages or code that strike me as interesting.
I used patchwork (link) and ggforce (link) in addition to ggrepel (link) to look at the data in the context of ggplot2 (link).
I was particularly interested in how patchwork helped me combine a range of images.
These work really well as PDF A4 pages and I thought they would be helpful summaries to stimulate conversation.
In the lull between the Group Games and the semi-finals of the Women’s T20 Cricket World Cup, I have been looking at the data I have collected and trying out some ggplot visualisation.
My attempts with the ggridges package failed and I am going to re-try. But in the meantime, here are two comparisons that use the ggrepel package. My data are for the total runs scored in each wicket partnerships. The data do not include the games decided by Duckworth-Lewis methods (England v Bangladesh).
I used ggplot2 and ggrepel in RStudio to explore these data.
The games were:
The scores were:
The teams that came back from conceding the first goal were:
My code example (using geom_label_repel) is:
library(ggplot2) library(ggrepel) df2 <- read_csv(“SFL05.csv”) ggplot(data=df2, aes(x=League, y=TE, label=Game)) + geom_point() + xlab(“League”) + ylab(“Time to Equalise (in Minutes)”) + labs(title = “Games in which the team that scores first loses”) + geom_label_repel(size=3)