Introduction

RStudio is a complete environment for working with the R language. Once you have got used to it you will find that it makes working with R far more productive than using the R console version. However some of the concepts involved in using RStudio may be new. RStudio provides an interface for working with R code, rather than an interface for running analyses directly.

Getting started with the RStudio server

The RStudio server version runs directly through any web browser. There is no need to install any software on your laptop, PC or tablet

Access to the server is through the following URL. This works both on and off campus.

http://r.bournemouth.ac.uk:8789/

Logging into the RStudio server

  1. Click on the URL http://r.bournemouth.ac.uk:8789/ in a browser. Use Firefox or Chrome.
  2. You will see a log in page.
  3. Log in using the username and the password you have been provided

RStudio server concepts

The RStudio server is an integrated platform for doing the following …

  1. Saving and sharing data files
  2. Running analyses
  3. Compiling reports
  4. Connecting to data stores
  5. Sharing analyses with others.

Advanced features can be used without any programming skills through sharing scripts. However you do need to become familiar with some new concepts in order to use the server. The RStudio server is ideal for collaborative work. You have your own permanent space on the server for saving your own work and building up a portfolio of useful analyses. Only one person can be logged in at any one time under your username. However I can always log into your user space at any time in order to help correct any errors and to give you advice on the analysis.

Finding your way around the interface

Once you are logged in you will see three sections of the interface by default. This will change to four sections when you begin using scripts in the interface.

Animated gif tour of the Rstudio interface.

Animated gif tour of the Rstudio interface.

Look carefully at the interface and learn to recognise the sections.

  1. The RConsole. This is showing up on the left hand side when you first log in. The console can be used for running R code interactively. There is a tab showing up labelled “terminal” as well. You won’t use this, as it is for more advanced programming.
  2. The environment, history and connections pane is at the top right of the screen. The environment tab is the one that is most used. This tab will show the data that is in the active workspace in R. The concept will only become clear after beginning to use R.
  3. The files, plots, packages, help and viewer tab at the bottom right. The files tab is the most important to understand at this stage. There will be no files in your home directory yet, nor will there be any folders.

A key concept to understand when using the server is that your home directory on the server is like a directory (folder) on your PC. It is rather like the university H drive. However it is all “encapsulated” on the server, which is also running R. So it is distinct from your H drive and it is not directly linked. In order to move data files and scripts into your home directory you must upload them. You will see buttons labelled New Folder, Upload, Delete, Rename and More. If you click on the More button you will also find an option to Export your files. The upload and the export buttons are frequently used to move files onto the server and to directly move files off the server. It is very important to be aware of this concept. Files saved on the server will always be available for use later. In contrast active analyses that take place in the server memory, as opposed to the server’s hard disk space, will be temporary and will be lost between sessions.