This repository contains the workshop materials for the single day workshop 'Introduction to R & Data' at Utrecht University. The workshop is organised by Research Data Management Support.
Click here to go to the workshop materials
R is a powerful programming language for data handling, data visualization, and statistics. In this workshop, we aim to give you the tools to start exploring R and all it has to offer by yourself.
The course will take you from the very basics in R syntax, to data handling and visualization using a set of packages designed for data science, known as the 'tidyverse'. We will also take some time to understand datasets and their architecture, preparing you to handle your own data in a clean, robust, and reproducible manner. We will work in RStudio and introduce R scripts as well as the R Markdown format: the latter is a great way to combine code and its output with text, allowing you to code in a narrative and intuitive way. Moreover, this way you produce a human-readable document with which you can easily share and showcase your work.
Check uu.nl/rdm for upcoming workshops. Registration is mandatory, and opens 2 months in advance of the course.
This course requires three things to be installed:
- The language R
- The IDE Rstudio
- The packages in tidyverse
Information on how to install these (and troubleshoot the installation) is on the installation guide.
You can best follow the materials using the online book that contains all course materials: https://utrechtuniversity.github.io/workshop-intruduction-to-r-and-data.
The following zipped file contains the files you need to follow along: course-materials.zip. You can also see the individual files here. They are:
├── data # datasets used in the afternoon session
│ ├── penguins_isotopes.xlsx
│ └── penguins_raw.tsv
├── baseR_exercises.Rmd # morning exercises
├── datascience_exercises.Rmd # afternoon exercises
├── datascience_solutions.html # solutions afternoon in html
└── datascience_solutions.Rmd # solutions afternoon in Rmd
- Slides and solutions for the morning: Introduction to R
- Slides for the afternoon: Data science with Tidyverse
The morning session (Introduction to R) has been recorded for self-study. Links to the videos and corresponding slides are below.
Subject | Slides | Video | Exercise | Answer slide | Answer video |
---|---|---|---|---|---|
Introduction to Rstudio | Slides | Video | - | - | - |
R Syntax & data types | Slides | Video | Exercise 1 | Answer slide | Answer video |
Vectors in R | Slides | Video | Exercise 2 | Answer slide | Answer video |
Data structures | Slides | Video | Exercise 3 | Answer slide | Answer video |
Missing data | Slides | Video | Exercise 4 | Answer slide | - |
Indexing vectors & lists | Slides | Video | Exercise 5 | Answer slide | Answer video |
Indexing a data frame | Slides | Video | Exercise 6 | Answer slide | Answer video |
Programming | - | Video (external) | - | - | - |
Programming: if statements | Slides | Video | Exercise 7 | Answer slide | Answer video |
Programming: functions | Slides | Video | Exercise 8 | Answer slide | Answer video |
Programming: loops | Slides | Video | Exercise 9 | Answer slide | Answer video |
Lectures and demos have been recorded for self-study. Links to the videos are below. The solution to all exercises can be found in the solutions document.
Subject | Video | Exercises |
---|---|---|
Introduction to Tidyverse | Video | - |
Importing data | Video | Exercise 1-4 |
Subsetting & mutating | Video | Exercise 5-8 |
Transformations & tidy data | Video | Exercise 9-12 |
Data visualization | Video | Exercise 13-15 |
- Book: R for Data Science
- R cheat sheets provided by the R community and RStudio, describing common procedures and packages. We use the following cheat sheets during our workshop:
The workshop 'Introduction to R & data' is developed and maintained by Research Data Management Support at Utrecht University. All videos were recorded by Jacques Flores. The material was written by Barbara Vreede, based on earlier versions by Jonathan de Bruin and Tessa Pronk.