Introduction to R for Biologists
March 06, 2023
Chapter 1 Introduction
This workshop is designed for the Cancer MSc Students in UCL Cancer Institute to introduce R (statistical-) programming language. I would appreciate if you participate in this pre-course survey so that I have an overview of the participants and tailor the lecture accordingly. Now, I will briefly touch on the history of R.
1.1 Definition
“R is a programming language for statistical computing and graphics supported by the R Core Team and the R Foundation for Statistical Computing.” - Wikipedia
1.2 Mini history
R is an open-source implementation of the S programming language, which was designed for statistical analysis. S was created by Rick Becker, John Chambers, Doug Dunn, Jean McRae, and Judy Schilling at Bell Labs around 1976. In 1991, statisticians Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, started on an implementation of S which had become the R programming language over time. In 1995, statistician Martin Mächler convinced them to make R a free and open-source software. The first official release came in June 1995, and the first official “stable beta” version (v1.0) was released on 29 February 2000. R is supported by a huge community level contribution as it is open source.
1.3 Installing R and RStudio
We will be using RStudio, which is an Integrated Development Environment (IDE) of R. To my view, it is very handy working in RStudio environment, rather than using simply R. However, to use RStudio, we’ll need to install the Base-R first, and then RStudio software. Base-R is the basic software which contains the R programming language. Desktop version of both software are totally free and open source.
1.3.1 Installing R
1.3.1.1 For Mac users
- Open an internet browser and go to https://cran.r-project.org
- Click on the “Download R for MacOS” link at the top of the page.
- Click on an appropriate link under Latest releases (as of today, the latest version is R 4.2.0.pkg).
- Save the .pkg file, double-click it to open, and follow the installation instructions.
- Now that R is installed, you need to download and install RStudio.
1.3.1.2 For Windows users
- Open an internet browser and go to https://cran.r-project.org
- Click the “download R for Windows” link under “Download and Install R” box.
- Click on the
base
version. - Click on the latest version of R for Windows (as if for this tutorial, the latest version is
Download R-4.2.0 for Windows (79 megabytes, 64 bit)
). Save the.exe
file on your computer. - Double-click on the
.exe
file, and follow the default installation instructions. Please do not install R on your network drive, it will make your life difficult. - Now that R is installed, you need to download and install RStudio.
1.3.2 Installing RStudio
1.3.2.1 For Mac users
- Go to https://www.rstudio.com and click on the “Download” tab on the top
- Click on “Download” button under RStudio Desktop.
- Click on the version recommended for your system (i.e. the latest Mac version), save the .dmg file on your computer, double-click it to open, and then drag and drop it to your applications folder.
1.3.2.2 For Windows users
- Go to https://www.rstudio.com and click on the “Download” tab on the top
- Click on
RStudio Desktop
and it will bring down to the freeOpen Source Edition
option. - Click on the
DOWNLOAD RSTUDIO DESKTOP
button - Now from the
Download the RStudio IDE
, click on theDownload
button. - Now click on the latest version of RStudio -
DOWNLOAD RSTUDIO FOR WINDOWS
button, save the.exe
file on your computer, double-click it to open, and then follow the default settings to install on your computer.
1.3.2.3 For Linux users
- Go to https://www.rstudio.com
- Choose the right package and download for your system
- Open the file in
Ubuntu Software Centre
- Click install and follow the set of instruction
1.3.2.4 RStudio Cloud
If you have further problem installing R on you computer, do not worry. You can log on to the RStudio Cloud. Simply -
- google for
RStudio Cloud
or go to https://rstudio.cloud/. - Sign up and log in (you can do it with you google or github profile)
- From the
New Project
button on the top-right, select forNew Rstudio Project
. - Now you will have a RStudio interface with 1 CPU and 1 GB of RAM which is sufficient for our workshop.