-
Create gitub repo and connect with RStudio
-
Structure project: data (don't touch your raw data), scripts, figures, tables
-
Create scripts (Console vs. Editor)
-
Why Editor (this is reproducible)
-
How to write better comments?
- comment start with hash (#)
- try to keep it short and concise
- try to write meaningful sentences
- try to set some predefined rules with your teammates
- don't try to write too few comments / too many comments
-
Variables
- variables are counted or measured.
- count: number of students (30, 40, 20...)
- measured: weight of a student (30.5, 40.5, 50.8...)
-
Creating variables in R
- use left-ward operator: a <- 10 (a is variable name, 10 value)
- variable naming convention: variables names must meaningful
-
Function: piece of code that can perform a particular task
- function name: mean(), median(), sum()
- parameter/argument: mean(1, 3, 5)
-
Getting Help from RStudio
- using help() function
- using ? (question mark)
-
Types of R Package
- CRAN: ggplot2, dplyr, tidyverse
- Bioconductor: DESeq2, MutationalPattern
-
Using R packages
- Collection of functions
- Install packages: install.packages("package_name")
- Use Packages: library(package_name)