Skip to main content

1.1) Select A Working Directory


Before you begin working on a project, you should create a folder on your computer where your files will be located. It’s best to create a new folder each time you start working on a new project or dataset, and copy into it any data files you need.

Now open the R programme (e.g. via Start > Programs > Statistics > R, or a shortcut icon if you can see one).

The first thing to do is to set the directory that you want to work in. First type getwd(), with nothing in the brackets, to see the address in your computer where R is currently running. You’ll probably want to change this, and the easiest way is to go to the File menu and click “Change dir…”, then navigate to where you want to be.

This first session has 8 key points to learn about the R language and how to use it. They are labelled from A to H.

Blue highlighted text like this contain exercises and demonstrations to try. Please type everything in Courier font into R as you go.

Now we’re ready to begin…