Install R. You’ll need R version 3.4.0 or higher.1 Download and install R for Windows or Mac (download the latest R-3.x.x.pkg file for your appropriate version of Mac OS).
Download and install RStudio Desktop version >= 1.0.143.
R and RStudio are separate downloads and installations. R is the underlying statistical computing environment, but using R alone is no fun. RStudio is a graphical integrated development environment that makes using R much easier. You need R installed before you install RStudio.
Launch RStudio (RStudio, not R itself). Ensure that you have internet access, then copy and paste the following command into the Console panel (usually the lower-left panel, by default) and hit the Enter/Return key.
install.packages("tidyverse")
A few notes:
Check that you’ve installed everything correctly by closing and reopening RStudio and entering the following commands at the console window (don’t worry about the Conflicts with tidy packages warning):
library(tidyverse)
This may produce some notes or other output, but as long as you don’t get an error message, you’re good to go. If you get a message that says something like: Error in library(somePackageName) : there is no package called 'somePackageName'
, then the required packages did not install correctly. Please do not hesitate to email me prior to the course if you are still having difficulty. In this email, please copy and paste what you typed in the console, and all of the output that streams by in the console.
For some classes (e.g., RNA-seq), you’ll need to install a few Bioconductor packages. These packages are installed differently than “regular” R packages from CRAN. Copy and paste these lines of code into your R console one at a time.
source("http://bioconductor.org/biocLite.R")
biocLite()
biocLite("DESeq2")
biocLite("ggtree")
A few notes:
n
at the prompt at hit enter.n
for no, and hit enter.Check that you’ve installed everything correctly by closing and reopening RStudio and entering the following commands at the console window, one at a time:
library(DESeq2)
library(ggtree)
If you get a message that says something like: Error in library(somePackageName) : there is no package called 'somePackageName'
, then the required packages did not install correctly. Please do not hesitate to email me prior to the course if you are still having difficulty. In this email, please copy and paste what you typed in the console, and all of the output that streams by in the console.
Several additional setup steps required for the reproducible research with RMarkdown class.
First, install R, RStudio, and the tidyverse package as described above. Also install the knitr and rmarkdown packages.
install.packages("knitr")
install.packages("rmarkdown")
knitr
, yaml
, htmltools
, caTools
, bitops
, rmarkdown
, and maybe a few others). Click “Yes” to install these.Click the Data link on the navbar at the top. You can download all the data needed by downloading this zip file or by downloading individual data sets as needed at the Data page.
Spend a few minutes to learn a little bit about Markdown. All you really need to know is that Markdown is a lightweight markup language that lets you create styled text (like bold, italics, links, etc.) using a very lightweight plain-text syntax: (like **bold**, _italics_, [links](http://bioconnector.org/markdown), etc.)
. The resulting text file can be rendered into many downstream formats, like PDF (for printing) or HTML (websites).
R version 3.4.0 was released April 2017. If you have not updated your R installation since then, you need to upgrade to a more recent version, since several of the required packages depend on a version at least this recent. You can check your R version with the sessionInfo()
command.↩
Installing/loading the tidyverse tidyverse will install/load the core tidyverse packages that you are likely to use in almost every analysis: ggplot2 (for data visualisation), dplyr (for data manipulation), tidyr (for data tidying), readr (for data import), purrr (for functional programming), and tibble (for tibbles, a modern re-imagining of data frames). It also installs a selection of other tidyverse packages that you’re likely to use frequently, but probably not in every analysis (these are installed, but you’ll have to load them separately with library(packageName)
). This includes: hms (for times), stringr (for strings), lubridate (for date/times), forcats (for factors), DBI (for databases), haven (for SPSS, SAS and Stata files), httr (for web apis), jsonlite (or JSON), readxl (for .xls and .xlsx files), rvest (for web scraping), xml2 (for XML), modelr (for modelling within a pipeline), and broom (for turning models into tidy data). After installing tidyverse with install.packages("tidyverse")
and loading it with library(tidyverse)
, you can use tidyverse_update()
to update all the tidyverse packages installed on your system at once.↩