美文网首页
Anaconda 安装R

Anaconda 安装R

作者: 提提_TI | 来源:发表于2020-05-25 10:48 被阅读0次

参考:
https://mp.weixin.qq.com/s/vhSpEoIkYP5Hky0lnyGVvQ

Anaconda下载地址:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=A
安装
sh Anaconda3-5.3.0-Linux-x86_64.sh
中间让你输入路径,这个路径使用你想安装的位置,程序会创建这个文件夹,如果这个文件夹已存在,会报错,使用-u参数,不想搞复杂一点的东西,直接写个为创建的路径。

by running conda init? [yes|no]
yes

然后source .bashrc

conda安装完毕,可以conda --help 或者which conda查看,而且他会在 .bashrc写入一些内容。

配置镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --set show_channel_urls yes

创建环境
conda info --envs # 查看环境
conda create -n single_cell # 创建一个环境
source activate single_cell # 激活进入 myenv环境
conda deactivate # 退出当前环境
conda env remove --namesingle_cell # 移除环境

安装软件

从conda网页内查找:http://bioconda.github.io/conda-recipe_index.html
conda search PACKAGENAME:运行命令查找是否存在
conda 安装R语言以及R包示例

conda info --envs # 查看环境
conda create -n R3.5 # 创建名为R3.5的环境
source activate R3.5
conda list #查看当前安装的软件
conda install r-base==3.6.3 #安装R语言3.6.3
conda install r-stringi # R包 以 r- 开头
conda deactivate # 退出当前环

安装指定版本!!!
conda install numpy=1.11:即安装能模糊匹配到numpy版本为1.11

              conda install numpy==1.11:即精确安装numpy为1.11的版本

安装seurat
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("multtest")
在安装Seurat
install.packages('Seurat')

其他方法参考(遇到过使用conda安装r包,R被降级情况,所以慎重)
https://www.jianshu.com/p/d90da82c4b54

无标题.png

使用BiocManager安装包时候连不上网。
下载源码到本地安装 install.packages("~/GSVA_1.36.0.tar.gz", repos = NULL, type = "source")
但是报错 ERROR: dependencies ‘BiocGenerics’, ‘S4Vectors’, ‘Biobase’, ‘SummarizedExperiment’, ‘GSEABase’, ‘BiocParallel’ are not available for package ‘GSVA’
这样安装包无穷无尽呐!
设置bio镜像 options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
再进行安装
安装包参考
https://www.jianshu.com/p/9e503a4e3563
https://www.jianshu.com/p/f47199afa8b9
个别的包还是用本地安装源码

另外安装其他的包,到bioconductor搜索
http://www.bioconductor.org/packages/release/bioc/html/SingleCellExperiment.html

某些情况下服务器使用devtools::install_github连接不上,
devtools::install_github("immunogenomics/harmony")
Error: Failed to install 'unknown package' from GitHub:
使用电脑先从github中下载下来,格式是zip,解压,再打包压缩为tar.gz,再进行本地安装。

本地安装也是要各种依赖包
设置镜像后options(repos=structure(c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")))
先直接install.packages("Hmisc")这么试试吧。

相关文章

网友评论

      本文标题:Anaconda 安装R

      本文链接:https://www.haomeiwen.com/subject/vwyzohtx.html