Tutorial for R
An introduction for social science students.

This is a tutorial for the statistical package called R. 

The website is primarily designed for students studying at Singapore Management University in the course Research Methods in Sociology and Political Science (IDIS100). 

However, the site is open for anyone in the public to find, and we would love it to be used more widely.

Navigating this website
In the sidebar to the left (and at the bottom of this homepage) you can see the links for navigating around the site.

The main headings are:
  • Home, this page.
  • Acknowledgements, thanking those who made this website possible.
  • Discussion, for anyone to ask questions, make comments, or give public feedback.
  • Feedback, which contains a link to a google form where you can provide specific feedback on each unit.
  • Quick reference, which contains a summary of all the commands on this website (plus some more!).
  • Quizzesfor SMU students, with instructions on how to login to elearn and find the quizzes (which count towards your final grade).
  • Unit 1, Basics of installing and working with R.
  • Unit 2, R for research methods.
Next to some of the headings you can see a little triangle, which you can click, and the sub menus will open or close. Each unit has three to seven sub-units.

For the beginner we suggest you start with Unit 1.1: Installing R, RStudio, and R Packages.

Taking a tutorial
All the tutorials have two alternative formats:
  • Video, where one of us talks through the entire tutorial.
  • Webpage, which is text and screenshots of the same tutorial.
You can use one or both. We recommend beginners use the videos. 

Testing your knowledge
At the end of each tutorial (except Units 1.1, 1.2, and 2.4) are a set of resources for you to practice with and test your knowledge:
  • Exercises, which are practical exercises you can do yourself.
  • Data files, which are the data files for the exercises. 
  • Quiz, which is a link to a quiz for SMU students, on eLearn. This quiz can only be accessed by people enrolled in the class, and is required for all students to take. If there is an exercise, then there is also a quiz. For instructions on how to access the quiz, please go here.
Improving these tutorials
There are two things you can do to help us improve these tutorials for future students:
  • At the end of each sub-unit, we would really appreciate it if you could fill out the feedback forms. You can find the feedback form here.
  • When you have completed all the tutorials, the Centre for Teaching Excellence at SMU (who funded this website) would like you to fill out a longer survey to help them evaluate it. You can find the survey here.
For a considerably more detailed introduction to statistics using R, we recommend "Discovering Statistics using R" by Andy Field, Jeremy Miles, and Zoe Field. You can find more about this book at:
Help for R
For help with R, we recommend checking out these websites and discussion forums:
We hope you enjoy these tutorials as much as we did making them :)

Nicholas Harrigan, Michael Genkin, and Bing Yang Tan.

PS: If you want to read a little background about R, check out these pages: