Absolute Beginners’ Guide to R
Part 1

Introduction to RStudio. How to get RStudio, and a basic introduction to the software.

Exploring data. Means, medians, and histograms.

Group differences. Means and standard deviations, by group. Filtering data. Effect size.

Evidence. Introduction to p values. Traditional betweensubjects ttest. Bayesian betweensubjects ttest.

Using RStudio projects. Creating a new project. Using an R script. Analysing your own data.

Entering data by hand. Entering data into a spreadsheet. Saving data into your RStudio project.

Calculating your module mark. How to calculate a final module mark from your component marks, using R.
Part 2

Interrater reliability. Percentage agreement. Cohen’s kappa.

Relationships. Frequency and contingency tables. Mosaic plots. Traditional chisquare test. Bayesian test.

Relationships, part 2. Density plots. Scatter plots. Correlation coefficient. Bayesian and traditional tests.
Further reading

Cheat sheet. Everything we’ve covered so far, condensed.

Reasons to use R. Why this course uses R to analyse data.

Other resources. A list of other Creative Commons resources about using R.
Putting R to work
These are mainly further practice in the skills you learned in Absolute Beginners’. Where the exercises contain completely new skills, these are shown in bold. Where the excercises extend a skill you’ve already been taught, these are shown in italics. The exercises are somewhat graded in difficulty, with Part 1 being the easiest and Part 3 containing some harder exercises.
If you are a current undergraduate student at Plymouth University, you should complete the accompanying Psych:EL (Psychology: Experiential Learning) activity first, in order to generate your own set of data. If you’re not, you can download sample data files here.
Part 1a

Autobiographical memory study. Entering data by hand, histograms.

Face recognition experiment. Means, filtering data, and a bar graph.

Spatial navigation tests. More on bar graphs.
Part 1b

Response compatibility experiment. Means, filtering data, standard deviations, and density plots.

Visual illusions. Filtering data, means, violin plot, Bayesian ttest.
Part 2
 Facial attractiveness experiment. Means, standard deivations, interquartile range, and density plots.
Part 3a

Police lineup. Contingency table, mosaic plot, Bayesian contingency test, means, density plot, Bayesian ttest

Risk taking. Means, combining data frames, filtering data, and density plots.
Part 3b

Animal Welfare. Percentage agreement, Cohen’s kappa, contingency tables, bar charts.

Creativity and the environment. Preprocessing, means, density plots, effect size, Bayesian ttest.

Political psychology. Means, filtering data, summarising data, density plots, effect size, Bayesian ttest, traditional ttest.
The next level…
 ANOVA. Draft plan for ANOVA course materials.
Source code
These teaching materials were generated using a combination of Markdown and RMarkdown. The full source code is available on github.
Licence
This material is distributed under a Creative Commons licence. CCBYSA 4.0.
Parts of this material have been adpated from these other Creative Commons materials:
 May, J. (2018). Getting Results with R.
 Whalley, B. (2018). Just Enough R.
 Wills, A. (2015). R for Experimental Psychologists.
Acknowledgements
Thanks to the following people for their feedback and advice on these materials:
Jackie Andrade, Eleanor Andrade May, Martyn Atkins, Patric Bach, Dale Barr, Chris Berry, Laura Charlton, Lisa DeBruine, Charlotte Edmunds, Emily Filewood, Giorgio Ganis, Phil Gee, Michaela Gummerum, Yaniv Hanoch, Cathryn Harries, Courtney Hooton, Angus Inkster, Jasmin Jones, Peter Jones, Laith Kahn, Chris Longmore, Jon May, Anthony Mee, Chris Mitchell, Millie Monks, Alyson Norman, Charlie Reynolds, Matt Roser, Paul Sharpe, Alastair Smith, Julian Stander, Sylvia Terbeck, Michael Verde, Ben Whalley.