NSC-R Tidy Tuesday

tidy tuesday

Improve your R skills in entertaining, inspiring and supportive sessions moderated by your own colleagues.

Author

Wim Bernasco

Published

March 17, 2022

The NSC-R Tidy Tuesday workshop sessions are inspired by the Tidy Tuesday initiative, which was aimed at providing a safe and supportive forum for individuals to practice their data processing and visualization skills in R while working with real-world data.

Sports in general and football (soccer) in particular provides a sheer endless source of open data that can be explored at various levels (player, team, match, competition) and from various perspectives. In this meeting Wim Bernasco used open data about football borrowed from a GitHub repository maintained by James Curley (James P. Curley (2016). engsoccerdata: English Soccer Data 1871-2016. R package version 0.1.5 DOI: 10.5281/zenodo.13158).

The engsoccerdata repository contains data on football matches from the UK Premier League and other European football leagues. In this Tidy Tuesday used data from almost a complete century (1929-2020) of matches in the Spanish League called La Liga.

We tried to answer a couple of simple questions:

  1. Is it true that there are less goals today than in earlier days?

  2. Is the number of goals related to the season of the year?

  3. Is playing home really an advantage?

  4. If so, has this advantage changed over time?

Wim Bernasco is a senior researcher at the Netherlands Institute for the Study of Crime and Law Enforcement (NSCR) and a professor in Spatial analysis of crime at the School of Business and Economics at the Vrije Universiteit Amsterdam. Most of his work in criminology is about the geography of crime, offender decision making and situational causes of crime.

Materials

  • The script that documents the analysis that Wim demonstrated during the workshop is available in this GitHub repository. It includes installation of packages, loading libraries, reading data and substantive analysis.

How to download files from GitHub

To download files from GitHub you can:

Clone the repository to create a local copy in your computer. To clone a repository, follow the instructions here.

Alternatively, you can:

  1. Download all files compressed in a ZIP. To do this, go to the repository and click on the green code button, then select download ZIP. Unzip the downloaded file into a folder on your local computer.
  2. Download a specific file. To do this, select the desired file in the repository and click on the raw button. Then right click on the new page and select save as. Don’t forget to put the proper extension in the save name, like .R or .Rmd.

Contact

Wim Bernasco

Citation

For attribution, please cite this work as (Bernasco 2022)

References

Bernasco, W. 2022. NSC-R Workshops: NSC-R Tidy Tuesday.” NSCR. https://nscrweb.netlify.app/posts/2022-03-22-nsc-r-tidy-tuesday/.