Psychological Research with R
An R Intro for psychologists whose dog regularly ate their statistics homework.
Last update: 2025-03-06
Welcome!
This book is a work in progress! Many chapters still contain placeholders/ bullet points and will be filled over the next couple of weeks!
Chances are, you are a psychology student and either starting to learn R or looking to refresh your memory. Or perhaps you need to look up a specific step that you can never quite remember (or is that just me?). Maybe you also came across this resource by pure chance - lucky you!
In any case I am glad you are here and hope you find both what you were and weren't looking for. This book is based on an in-person introductory R course from the University of Konstanz. I tried my very best to cover all the basics on working with R from the ground up. Following the whole course should enable you to write your very own R Markdown report, taking full advantage of some of the most important and common features of R.
About
...this book
It's completely based on a course, so you can either look up specific facts or go through each chapter as you would a lesson.
This book is quite opinionated, meaning I included all the lovely things that I like to work with. You might prefer other packages and that is completely okay - I still appreciate you reading my suggestions. As with anything in life, a lot can be learned from other peoples approaches to things.
Each chapter will end with a "Wrap-up and Further Resources "-section, i.e. a little collection of facts you should now know and some links for further reading. Also, in most chapters you will find some exercises or hidden code snippets, so you can test your skills as you go along.
Important: I will present you with a lot of different packages that I believe will make your life easier in this book.
Please make sure that you have them installed if you want to try out the code.
You can typically install any package by typing install.packages("packagename")
- substituting packagename for the name of the package, e.g. dplyr - into your R console and hitting Enter.
Some packages may not be installable this way, in which case I will explicitly mention how to install them where they are first used!