Skip to content

UtrechtUniversity/workshop-introduction-to-R-and-data

Repository files navigation

Workshop: Introduction to R & Data

DOI

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

Workshop description

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.

Upcoming workshops

Check uu.nl/rdm for upcoming workshops. Registration is mandatory, and opens 2 months in advance of the course.

Installation requirements

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.

Course materials

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 videos

Morning: Introduction to R

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

Afternoon: Data science with Tidyverse

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

External resources

Acknowledgements

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.