使用Miniconda安装R语言环境

使用Miniconda安装R语言

  1. 下载Miniconda3-latest-Linux-x86_64.sh

  2. 静默安装 sh Miniconda3-latest-Linux-x86_64.sh -b -p /opt/mids/Miniconda3-Rlang

  3. 激活conda环境:/opt/mids/Miniconda3-Rlang/bin/conda init

  4. 配置镜像(可选,如下载安装慢,可更改镜像源)

    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 config -
    
  5. 安装R:conda install R

  6. conda search PACKAGENAME:运行命令查找是否存在

  7. 安装R依赖包rjson:conda install -c conda-forge -y r-rjson

  8. 安装R依赖包Rserve:conda install -c conda-forge -y r-rserve

  9. 安装R依赖包ggplot2:conda install -c conda-forge -y r-ggplot2

  10. 安装R依赖包stringi:conda install -c conda-forge -y r-stringi

  11. 安装R依赖包rJava:conda install -c conda-forge -y r-rjava

  12. 安装R依赖包Marix:conda install -c conda-forge -y r-matrix

  13. 安装R依赖包forecast:conda install -c conda-forge -y r-forecast

  14. 查看已经安装的包,进入R:installed.packages()

  15. 清理缓存和安装包:conda clean -y -a

原文地址:https://www.cnblogs.com/flowerbirds/p/14191779.html