Introduction to R and RStudio

Introduction

This tutorial will introduce you to the statistical software R and the RStudio graphical user interface.

This tutorial consists of 3 sections:

  • the first section provides a very quick introduction to the R and RStudio software;
  • the second section uses an adapted series of interactive Swirl lessons to practice the basics of programming in R;
  • the third section consists of some other lessons, e.g. on project management, control structures and plotting.

Format

Throughout these pages, both inline R code (e.g. x <- 3), as well as chucks of R code and its output appear. A R code chuck is formatted like this:

print("Hello world!")

and its corresponding output is shown following 2 hash signs (##) like this:

## [1] "Hello world!"

Mostly, R code and output are shown in the same blocks, like this:

print("Hello world!")
## [1] "Hello world!"

Acknowledgements

These lessons cover a selection and altered version of the courses supplied here. The template used to generate this website is based on bookdown and an adapted version of the PsyTeachR template.