乐于分享
好东西不私藏

如何下载R包等基础技能

如何下载R包等基础技能
如何下载R包等基础技能

## 一、packages to install and manage R packages

options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")options(repos=structure(c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")))  install.packages("pacman")install.packages("BiocManager")install.packages("devtools")pacman::p_load("ggplot2")pacman::p_load("org.Hs.eg.db")pacman::p_load("org.Mm.eg.db")pacman::p_load("clusterProfiler")

# Check if the packages are successfully installed.

library("gplots")library("ggplot2")

##二、如何安装github上的R包

#下载到本地后如何安装

library(devtools)install_local("E:/BaiduNetdiskDownload/immunarch-master.zip")library(remotes)  install_local("E:/BaiduNetdiskDownload/scRepertoire-master/")

#如何直接在线下载

Installation of Master Branch

immApex is now required for the underlying processes of scRepertoire make sure if not using bioconductor, to call both during installation.

remotes::install_github(c("BorchLab/immApex""BorchLab/scRepertoire"))

Installing from Bioconductor

The current version of scRepertoire is also available on Bioconductor.

if (!require("BiocManager"quietly=TRUE))     install.packages("BiocManager")
BiocManager::install("scRepertoire")

Legacy Version 1

If you are looking for version 1 of scRepertoire - there is a static version available below:

devtools::install_github("BorchLab/scRepertoire@v1")
system("R CMD INSTALL E:/BaiduNetdiskDownload/scRepertoire-master/")

或者直接在 Windows 的 CMD 窗口里输入:

R CMD INSTALL E:/BaiduNetdiskDownload/scRepertoire-master/

##三、保存图片的代码

library(ggplot2) ggsave( plot = pall,"主要类型marker基因展示b.pdf",width = 20,height = 25,units = "cm")ggsave( plot = pall,"主要类型marker基因展示b.png",width = 20,height = 25,units = "cm")ggsave"分组不同色彩GO柱状图.pdf",width = 20,height = 25,units = "cm")ggsave"分组不同色彩GO柱状图.png",width = 20,height = 25,units = "cm")