1

For Python I'm able to use Pyenv within the terminal to install and manage different python versions, from which I can create virtual environments for use in projects.

With R I am able to use renv to create an R environment, but I don't know how to go about installing and manging different versions of R itself from the terminal.

I'm on mac os - but expect the solution to work for either mac or Linux.

Similar questions

I appreciate there are questions similar to this, what I've seen are the following and aren't suitable for my issue:

baxx
  • 3,956
  • 6
  • 37
  • 75
  • Did you have a look at [packrat](https://rstudio.github.io/packrat/) or [renv](https://rstudio.github.io/renv/articles/renv.html)? – Waldi Sep 06 '20 at 19:39
  • 1
    @Waldi packrat is redundant given renv afaik - I use renv (as stated in the post) to manage packages. I'm looking for something which serves the same purpose as Pyenv, which manages python versions (not packages). – baxx Sep 06 '20 at 21:13
  • 1
    I'd say the simplet method might simply be to create a 'shortcut folder' and name shortcuts after each version, pointing for the appropriate version (and add the folder to PATH). Possibly anaconda can do this in one go. If you're looking for better version control and reproducibility, move on to using [docker](https://www.docker.com/) images and work from within a docker container. Ever since moving to docker, my computer seems has become more like a shell for various containers rather than actually installing programs on the computer itself. – Oliver Sep 06 '20 at 22:34

1 Answers1

1

came across this question, and there is now a more modern solution for this: rig https://github.com/r-lib/rig

which will manage your R version, without itself depending on R (which renv does)