R及R包安装方法
2020-04-02 本文已影响0人
BBio
R
及R
包安装方法
R
安装
#下载R,以win版为例
https://mirrors.tuna.tsinghua.edu.cn/CRAN/



Rstudio
切换R运行版本
菜单栏Tools->Global Options->

R
包安装方法
-
install.packages()
安装CRAN
中的包#参数详解 #pkgs:r包名称,可以多个。或者网址,本地下载好的r包 #lib:安装路径,省略则自动安装在.libPaths()中的第一个路径下 #repos:CRAN镜像网址,NULL则可以安装本地包 #method:下载文件的方法,具体可以查看download.file函数 #destdir:下载包的存放路径,默认当前的临时文件夹 #dependencies:安装依赖包,默认安装,或者输入包的名称 #type:安装包的类型,二进制文件还是源码 #quiet:不输出到屏幕
install.packages("ggsci") install.packages("https://mirrors.e-ducation.cn/CRAN/src/contrib/ggsci_2.9.tar.gz",repos=NULL) install.packages("/tmp/ggsci_2.9.tar.gz",repos=NULL)
-
biocLite/BiocManager
安装bioconductor
中的包#3.5.0之前版本的R安装方法 source("http://bioconductor.org/biocLite.R")安装BiocInstaller biocLite("ggsci") BiocInstaller::biocLite('ggsci') #3.5.0之后版本的R安装方法 install.packages("BiocManager") BiocManager::install("ggsci")
-
命令行安装
R -q -e install.packages("ggsci") R CMD INSTALL /tmp/RtmpptJpuQ/downloaded_packages/ggsci_2.9.tar.gz
镜像网址
University of Science and Technology of China:https://mirrors.ustc.edu.cn/CRAN/
TUNA Team, Tsinghua University:https://mirrors.tuna.tsinghua.edu.cn/CRAN/
Elite Education:https://mirrors.e-ducation.cn/CRAN/