> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Using R language with Anaconda

<Note>
  As of November 4, 2025, the Anaconda R channel is no longer actively maintained. No new R versions, package updates, or security updates will be provided. The channel and its contents will remain available, and you can still download any R packages we have previously built. Please reference our [announcement](https://anaconda.com/blog/changes-to-anacondas-r-channel-support) for more information.
</Note>

With Anaconda (or Miniconda), you can install the R programming language and over 6,000 commonly used <Tooltip tip="A bundle of code, data, and documentation written in the R language.">R packages</Tooltip> for data science. You can also create and share your own custom R packages.

<Note>
  When using conda to install R packages, add `r-` before the regular package name. For instance, to install rbokeh, use `conda install r-rbokeh`. To install rJava, use `conda install r-rjava`.
</Note>

The R Essentials bundle contains approximately 200 of the most popular R packages for data science, including the IRKernel, dplyr, shiny, ggplot2, tidyr, caret, and nnet.

The version of the R interpreter installed into your R environments is based on the version of the `r-base` package.

<Note>
  Run the commands in the following sections in Anaconda Prompt (Terminal on macOS/Linux).
</Note>

## Updating R packages

<Warning>
  Exercise caution when using conda to update RStudio or other R packages to their latest versions. This might break your conda RStudio environment.
</Warning>

* Update all of the packages and their dependencies by running the following command:
  ```sh theme={null}
  conda update r-caret
  ```

* If a new version of a package is available in the R channel, update specific packages by running the following command:
  ```sh theme={null}
  conda update
  ```

## Creating and sharing custom R bundles

Creating and sharing custom R bundles is similar to creating and sharing conda packages. In the following example, we will create a simple custom R bundle metapackage named "Custom-R-Bundle".

1. Create the metapackage "Custom-R-Bundle" that contains several popular programs and their dependencies by running the following command:

   ```sh theme={null}
   conda metapackage custom-r-bundle 0.1.0 --dependencies r-irkernel jupyter r-ggplot2 r-dplyr --summary "Custom-R-Bundle"
   ```
2. Upload the new metapackage to your channel on [anaconda.org](https://anaconda.org) by running the following commands:

   ```sh theme={null}
   conda install anaconda-client
   anaconda login
   anaconda upload custom-r-bundle-0.1.0-0.tar.bz2
   ```

Anyone can now access your custom R bundle from any computer by running the following command:

```sh theme={null}
conda install --channel <USERNAME> custom-r-bundle
```

<Comments>
  Replace \<USERNAME> with your anaconda.org username.
</Comments>

## Creating an environment with R

1. [Download and install Anaconda](/getting-started/anaconda/install/overview).

2. Create a new <Tooltip tip="An isolated folder containing specific conda packages and dependencies that won't interfere with other projects. Each environment maintains its own versions of libraries and packages, so changes in one environment don't affect others.">conda environment</Tooltip> with all the `r-essentials` conda packages built from CRAN by running the following command:

   ```sh theme={null}
   conda create --name r_env r-essentials r-base
   ```

3. Activate the environment by running the following command:

   ```sh theme={null}
   conda activate r_env
   ```

4. List the packages in the environment by running the following command:

   ```sh theme={null}
   conda list
   ```

The list shows that the package `r-base` is installed and `r-` is listed in the build string of the other R packages in the environment.

## Creating a new environment with R

When creating a new environment, you can use R by explicitly including `r-base` in your list of packages:

```sh theme={null}
conda create --name <ENV_NAME> r-base r-essentials
conda activate <ENV_NAME>
```

<Comments>
  Replace \<ENV\_NAME> with a name for your R environment.
</Comments>

## Uninstalling R Essentials

Uninstall the R Essentials package by running the following command:

```sh theme={null}
conda activate <ENV_NAME>
conda remove r-essentials
```

<Comments>
  Replace \<ENV\_NAME> with the name of the R environment.
</Comments>

<Note>
  This removes only R Essentials and disables R language support. Other R language packages are not removed.
</Note>

## Resources

Hundreds of [R Language packages are available for use with Anaconda](/getting-started/working-with-conda/reference/r-language-pkg-docs) with several ways to get them.
