R packages
- Setting mirrors channel
options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/")
- Install package
cmd line:
install.packages(“<package>”)
or
BiocManager::install(“<package>”)
- Loading package
cmd line:
library(<package>)
or
require(<package>)
Five basic functions of "dplyr"
- mutate(): add new column
- select(): select by column
- filter(): selest by line
- arrange(): sort the hole table by a column/columns
- summarise(): summarise the data, can be enhanced with "group_by"
Two practical usages of "dplyr"
- Pipeline operation
- count the unique value of a column
Use "dplyr" to handle relationships of data
connect tow tables
Attention: do not introduce factor