Skip to content

Instantly share code, notes, and snippets.

@adefelicibus
Last active February 12, 2021 18:12
Show Gist options
  • Save adefelicibus/2ec97b5f8f12b4d71ed749d4f15ccd73 to your computer and use it in GitHub Desktop.
Save adefelicibus/2ec97b5f8f12b4d71ed749d4f15ccd73 to your computer and use it in GitHub Desktop.
How to install R 3.2.2 using a conda environment on CentOS

Download Miniconda

  • Python 2.7

    # 32 bits
    $ wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86.sh
    # 64 bits
    $ wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
  • Python 3.5

    # 32 bits
    $ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86.sh
    # 64 bits
    $ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

Installation

This will install minicondaX at your user's directory by setting the prefix.

$ bash Miniconda...sh

After installation, accept the change to the .bashrc file, logout from the computer and log in again.

Create a new environment

You can create as many environments as your like, and they can have diffrent versions of packages, like python, R, for exemplo. At the env creation, you must insert a package at this time. In this exemple, I passed the package called pip.

$ conda create -n name_of_env pip

You must activate the environment to use all the installed packages.

$ source activate name_of_env

After you are done of work, you must deactivate from the environment.

$ source deactivate name_of_env

Install packages

These two lines will install R at version 3.2.2 and all the needed packages.

$ conda install -y -c r r-essentials=3.2.2
$ conda install -y -c bioconda r-sleuth

At this time, you should be able to use the installed packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment