Is it possible to install multiple versions of R?

The short answer is yes, it is possible to have multiple versions of R installed on your computer. The R programming language, like many others, is constantly being updated and improved. As a result, it is common for data scientists and statisticians to use and maintain multiple versions of R.


The primary reason for maintaining multiple versions is to ensure backward compatibility. Not all R packages are immediately updated to work with the latest version of R. Some packages may work better, or may only work with an older version. Another reason is that some older scripts may not work correctly with the newer versions of R due to changes in syntax or features.


While it is possible, having multiple versions of R on the same machine can be complex to manage without the use of some utilities. For example, on Unix-based systems (such as MacOS and Linux), tools such as RSwitch and Renv can be used. On Windows, the installr package can help manage different versions of R.


The following article explains how to change the R version in RStudio: