1.2 RStudio IDE
RStudio is a free and open source integrated development environment (IDE) for R. An IDE is most typically used in software development where a user is presented with a unified environment where code can be edited, documentation can be read and debuggers can be applied to understand what is happening in the code and why it may not be working as expected.
In bioinformatics (or computational biology) an IDE provides us with an integrated approach to writing R scripts (or markdown documents), interacting with our data as we implement our script and provides us with an overview of the objects that we have created and their content. RStudio also retains a history of the commands that we have typed, a collection of the figures that we have prepared and provides access to method documentation and package vignettes. We will consider all of these aspects during this workshop. The RStudio IDE is great for the preparation of scripts and reports since the code syntax-highlighting helps you discover typos and errors in your code and even spelling mistakes.
RStudio comes in two main flavours: a Desktop version that runs straight off the computer that we are sitting at and a Server version that can be hosted on a slightly more capable computer in a data centre. The server version is sometimes preferable since it is accessed via a web-browser and can be configured with massive memory and disk allocations that might not be practical for a normal laptop. The server version is platform-agnostic (from the user perspective that is; the server itself needs to run Linux) and the Desktop version can be run on Windows, Mac and Linux computers. An example RStudio session running on the Desktop version is shown in Figure 1.1.

Figure 1.1: A screenshot of the RStudio session used in the preparation of this course material. The document being prepared is displayed in the top left pane. A figure is shown in the bottom right pane and the loaded environment variables are presented in the top right. Having access to all of these information in a single application is simpler than managing an active R console, a text editor and an image viewer.
RStudio integrates very cleanly with a number of best scientific working practices (data sharing, reproducible research and research documentation). RStudio allows for experiments to be performed in projects - this allows you to create a separate workspace for each study that you are performing. Code can be shared between projects easily and Version Control (Subversion and Github) facilitate the sharing of workflows and methods with other researchers.
For this course we recommend that you use our server version that has been preconfigured for the software, packages and data that will be used.
Open up an RStudio server client and create a project
-
Open a web browser (not Internet Explorer) and connect to the server given to you by the trainer. Use the username and password that we have provided to connect and explore the options available in the top bar.
-
Explore the interface
- Where is the Files tab? What does it show? Can you see the data folder?
- Click the data folder to look inside, keep going until you get to some files
-
Click on the Packages tab and look at the list of packages that are installed in R. If you are ahead, scroll down and click on the methods name. This should bring you to the Help tab, see what additional functions you can do using this package.
- We will talk about what packages are later in the workshop.
-
In the top-right corner of the Help tab is a search text field. Type in “print” and hit enter (if the autofinish starts to pop up click on print). This will show you the
print()
function and what parameters it accepts.