-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path01_r_setup.Rmd
executable file
·56 lines (48 loc) · 2.21 KB
/
01_r_setup.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: "Setup Experiment"
author: "[email protected]"
date: "1/16/2020"
output:
html_document:
df_print: paged
objectives: Program Setup
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
### To install R 3.5.3+
- Install R 3.5.3+ (Note that we have tested R scripts in the session with R3.5.3)
- Open an internet browser
- For Windows user: Download [R3.5.3](http://healthstat.snu.ac.kr/CRAN/bin/windows/base/old/3.5.3/R-3.5.3-win.exe) or [R3.6.2](http://healthstat.snu.ac.kr/CRAN/bin/windows/base/old/3.6.2/R-3.6.2-win.exe)
- Click "Download R for Windows" and save the executable file somewhere on your computer. Run the .exe file and follow the installation instructions.
- For MacOSX user: Download [R3.6.2](https://cran.seoul.go.kr/bin/macosx/R-3.6.2.pkg)
- Now that R is installed, you need to download and install RStudio.
### To install Rstudio
- Go to [rstudio](www.rstudio.com) and click on the "Download RStudio" button.
- Click on "Download RStudio Desktop."
- Click on the version recommended for your system, or the latest Windows version, and save the executable file. Run the .exe file and follow the installation instructions.
### To install R modules to accomplish the experiments in the tutorial
- Launch Rstudio
- Install the following R library modules
- Note that Rstudio may ask you whether user want to update an R module. Answer 'N' to all the questions.
```{r r_module_setup, echo=TRUE, eval=FALSE}
install.packages('BiocManager')
library("BiocManager")
tutorial_pkgs <- c('multtest','R.utils','Seurat','data.table','openxlsx','reshape2','dplyr','reticulate','cowplot','grid','gridExtra','ggplot2','randomcoloR','pheatmap','stringr','tools')
for (pkg in tutorial_pkgs) {
if( !is.element(pkg, .packages(all.available = TRUE)) ) {
message(sprintf("installing %s ...",pkg))
BiocManager::install(pkgs=pkg)
message("Done.")
}
message(sprintf("loading %s ...",pkg))
library(pkg,character.only = TRUE)
}
```
### Notice
- From this point, we will work R scripts within Rstudio.
- Change your working directory to each session to access Rmd file.
### Things to know
- Installing R libraries
- `getwd()` to find the current working directory
- `setwd()` to change the working directory