Introduction to R and Rstudio


Figure 1

Four panes of RStudio, showing the editor, console, environment and plots panel

Figure 2

A cross in the margins where a line of code is syntatically incorrect

Figure 3

Mousing over the cross reveals the message "expected , after expression" and "unmatched opening bracket (

Figure 4

A function takes as input (x,y), does some stuff, and outputs z
A black box function

Figure 5

Fail fast Image credit

Reading in data


Tidy data


Figure 1

Pivoting longer

Figure 2

Pivoting wider

Data wrangling


Figure 1

dplyr::mutate() image credit

Figure 2

dplyr::filter() image credit

Figure 3

dplyr::select() image credit

Figure 4

dplyr::arrange() image credit Here I sort for the hottest days, using desc() to get the maximum temperatures in descending order.

Figure 5

left join

Data visualization


Figure 1


Figure 2


Figure 3


Figure 4


Figure 5


Figure 6


Figure 7


Figure 8


Figure 9


Figure 10


Figure 11


Figure 12


Figure 13


Figure 14


Figure 15


Figure 16


Figure 17


Figure 18


Figure 19


Figure 20


Figure 21


Figure 22


Figure 23


Bioconductor and other bioinformatics packages


Figure 1

Bioconductor logo

Figure 2


Using R markdown for notebooks and documents


Figure 1

Button for knitting documents

Figure 2

Button for knitting noteooks

Version control with git


Figure 1

Git commit timeline Image credit

Figure 2

Git branches Image credit

Figure 3

Global options

Figure 4

A new repo on github

Figure 5

Git pane

Figure 6

Three sections of a git project

Figure 7

A staged file

Figure 8

Git diff

Figure 9

Git commit You should get a pop-up telling you the commit was successful.

Figure 10

Git commit success

Figure 11

Working with remotes

Figure 12

Pulling and pushing

Figure 13

A failed push

Figure 14

A failed push

Case study


Figure 1


Figure 2


Figure 3


Figure 4