R for Music Research


Meet Alex


Getting started with R and RStudio


Figure 1

Screenshot showing the RStudio interface with three main panes: the console on the left, the environment/history/connections tab in the top-right pane, and the plots/packages/help tab in the bottom-right pane. Menus and toolbars are located at the top.
The default layout in RStudio

Figure 2

Screenshot showing the RStudio interface with four main panes: the script editor in the top-left pane, the console in the bottom-left pane, the environment/history/connections tab in the top-right pane, and the plots/packages/help tab in the bottom-right pane. Menus and toolbars are located at the top.
The RStudio layout now including the R script editor

Creating a directory structure


Figure 1

Small icon showing a yellow folder with a white plus sign on a green circle
New folder icon

Reading survey data in R


Figure 1

The dummy data set in Excel format
The dummy data set in Excel format

Figure 2

The dummy data set in csv format
The dummy data set in csv format

Inspecting your data in R


Cleaning your data


Analysing survey data


Visualising survey data with ggplot2


A second case study for music research


Some best practices when writing code in R