Although we can use Anaconda’s native functionality to create R environment, as of this writing, the functionality only installs R version 3.6. We can create a new R environment with the latest R version following these steps:
- Run Anaconda cmd
- conda create –name r4-base #create a new environ called r4-base
- conda activate r4-base
- conda install -c conda-forge r-base
- conda install -c conda-forge/label/gcc7 r-base
- conda install jupyter
Once you run the second step, Conda would show you where the directory of the environment. Next you need to navigate to R.exe resides in the subdirectory of the environment.
If the environment directory is D:\Programs\Anaconda\envs\r4-base\, then R.exe should be in D:\Programs\Anaconda\envs\r4-base\lib\R\bin.
Execute R.exe, then run the following commands
That’s it. Now you can use the latest R version in Jupyter.
Thanks to these two posts: