A big part of psychology is collecting data about people, visualizing it (graphs etc.), and drawing conclusions. RStudio, like Excel, is computer software that helps us to do that. RStudio is rapidly becoming the standard tool for serious data analysis in psychology, because it’s powerful, relatively easy to use, and free. In these series of worksheets, you’ll learn the basics of how to use it.
Using your web browser, go to an RStudio server and log on, using the username and password you have been given.
NOTE: We strongly recommend using the Firefox web browser to access RStudio. If you are having problems and you’re using something other than Firefox, the first thing to try is to download and install Firefox on your machine and see if it fixes the problem. Firefox is free and open source.
If that works, you should see something like this:
We’ll go through what it all means in a bit. But, first, we’re going to…
Create a new project
RStudio uses projects to help you keep your work organized, and to make sure you have a record of your analyses. You should start a new project each time you start a new module in your degree. Here’s how to create a new project:
- At the top right of RStudio, you will see a little blue cube, with the text “Project: (none)”. Click on this, and select “New project”.
- Now click “New Directory”
- Now click “New Project”
- Next, type in a name for the project that makes sense to you in the “Directory name” box. (Plymouth University students: Use the code of the module you’re currently studying as your project name, e.g. psyc519**). Then click “Create project”.
- Now, create a R script. An R script is a record of the analyses you have done. You create an R Script by clicking on the white plus sign on a green background (see below), and then clicking on “R Script”.
If everything worked well, your screen should now look like this:
You should be able to see four parts:
The Script window - This is the rectangle on the top left. This is where you will tell R what to do. It only does what you tell it.
The Console window - This is the rectangle on the bottom left. This is where R prints the answers to your questions.
The Environment window - This is the rectangle on the top right. It’s where R keeps a list of the data it knows about. It’s empty at the moment, because we haven’t given R any data yet.
The Files - This is the rectangle on the bottom right. This is a bit like the File Explorer in Windows, or the Finder on a Mac. It shows you what files are in your R project.
Please now move on to the next worksheet.