My preferred way to access [[R]] is by installing it within a [[mamba]] environment and run it in a [[Jupyter Notebook]].
- Create an environment for the project
- Install [[r-essentials]]
- Open the directory with [[VS Code]] (alternatively, launch Jupyter Notebook with the command `jupyter notebook`).
```bash
mamba create -n R-env
mamba activate R-env
mamba install r-essentials
code .
```
- Create a new Jupyter Notebook using the R kernel in the environment you just created (`Ctrl+Shift+P` to open the command palette and begin typing to select "Create New Jupyter Notebook"; in the top right corner, click **Select Kernel** and select the R kernel in the environment you just created).
> [!Tip] Why mamba?
> Installing the package `r-essentials` and all dependencies times out on my machine when using `conda`. `mamba` is a drop in replacement for `conda` that is much faster and permits installation of R in this way.