Starting out with esquisse

I have discovered the esquisse package in R (link). It is described as “a ‘shiny’ gadget to create ‘ggplot2’ charts interactively with drag-and-drop to map your variables. You can quickly visualize your data accordingly to their type, export to ‘PNG’ or ‘PowerPoint’, and retrieve the code to reproduce the chart”.

Information about the package, authors and maintainers can be found on CRAN (link). 

I have compiled a brief GitHub repository to share some resources for this introduction. I include the data.frame I used (link).

My first attempt to use esquisse functionality:

I found this package one of the most intuitive CRAN packages I have used. I do have some experience with ggplot2 and understand that I will need to return to it to provide further details. The Shiny format of esquisse really appeals to me. I appreciated the ease of drag and drop that enabled me to modify my visualisations without the need to code.

It will become my first look tool for data visualisation.

Women’s T20 Group Games

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 Baptiste Auguie’s suggestions for laying out multiple plots (two in my case) and installed the grid and gridExtra packages to help me.

Scoring first and losing in association football: some European data

I have a particular interest in teams that score first and lose in six of the European football leagues.

We are up to: week 4 of the 2018-2019 season in England, France and the Netherlands; week 3 in Italy and Spain; and week 2 in Germany.

So far, there have been 22 games in these leagues in which the team that scored first lost:

The csv file is available on GitHub.

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)

I found Kamil Slowikowski’s ggrepel examples particularly helpful.

Photo Credit

Heracles Almelo (Twitter)