By the end of the workshop, you will be able to:
Write reproducible reports using R Markdown / Quarto.
Clean and wrangle data into appropriate forms for visualisation and analysis.
Use the ggplot2
package for creating a range of plots.
Share/receive code to conduct a brief code review.
Time | Task |
---|---|
11:00 | Introduction and introduction to R |
12:00 | File management and reproducible documents |
13:00-13:30 | Lunch |
13:30-14:30 | Data visualisation |
14:30-15:30 | Data wrangling |
15:30-16:30 | Independent task and code review |
Perfect for researchers
Well-integrated tool popular in psychology researchers.
Ecosystem of well-maintained packages (e.g., tidyverse).
Develop a complete reproducible pipeline from raw data to your analysis.
Perfect for educators
Image: Wickham et al. (2023)
No one is going to be an expert R user after today; you will learn by doing.
There is nothing wrong with copying and adapting code; you need to know enough to know how to find solutions.
Your code does not need to be pretty, just annotated and reliable.
Intended learning outcomes:
By the end of this part, you will be able to:
Navigate and interact with RStudio.
Use an R function and find help documentation.
Install and load R packages.
Assign content to an object.
Intended learning outcomes:
By the end of this part, you will be able to:
Understand and set your working directory, either manually or through creating an R project.
Create and render a Quarto file to create a reproducible document.
Use inline code to combine text and code output in your reproducible documents.
Identify and fix common errors in rendering Quarto files.
Target dataset: Lopez et al. (2023) on visual cues and food intake.
Intended learning outcomes:
By the end of this part, you will be able to:
Understand the ggplot2
layering system of creating plots.
Create and edit histograms to visualise the frequency of observations collated into bins.
Create and edit barplots to visualise the frequency of different categories.
Create and edit a scatterplot to visualise the relationship between two continuous variables.
Create and edit a violin-boxplot to visualise the density of data points in a continuous outcome.
Save plots as an image to use in reports or presentations.
Target dataset: Alter et al. (2024) on assessing the perceived value of statistics software.
Intended learning outcomes:
By the end of this part, you will be able to:
Join two data sets by matching one or more identifying columns in common.
Select a range and reorder variables in your data set.
Modify or create variables, such as recoding values or creating new groups.
Filter observations to retain a subset of your data.
Summarise your data to calculate summary statistics.
Restructure data into different formats, such as long and wide form.
String together multiple functions using pipes.
Inspired by Ivimey-Cook et al. (2023), we will explore the four Rs:
Is the code as reported?
Does the code run?
Is the code reliable?
Are the results reproducible?
Target dataset: Farias et al. (2019) on motivations to go on a pilgrimage.
Intended learning outcomes:
By the end of this part, you will be able to:
Apply your wrangling and visualisation skills to a new dataset.
Understand the basic principles of code review for quality control.
Conduct a code review of your partner’s code.
To finish, I would really appreciate feedback on the workshop: