7.1 Install Oracle R Distribution on Linux in a Non-Default R_HOME
The Oracle R Distribution RPMs can be installed to a directory other than
        the default Linux R_HOME, /usr/lib64/R.
               
The procedure in the following example installs the Oracle R Distribution 3.6.1 RPMs to a non-default location and still allows the user to invoke the previously installed version, R-3.3.0.
The example installs the RPMs into the directory /opt/R361. It
                                installs the following RPMs:
                  
R-3.6.1-1.el7.x86_64.rpm
R-core-3.6.1-1.el7.x86_64.rpm
R-devel-3.6.1-1.el7.x86_64.rpm
libRmath-3.6.1-1.el7.x86_64.rpm
libRmath-devel-3.6.1-1.el7.x86_64.rpm
libRmath-static-3.6.1-1.el7.x86_64.rpm- 
                        
From the directory that contains the RPMs, install the Oracle R Distribution 3.6.1 RPMs to a non-default location using the
--prefixflag:# rpm -i *.rpm --prefix=/opt/R361 - 
                        
Set
R_HOMEto the R-3.6.1 location and add$R_HOME/bintoPATH:# export R_HOME=/opt/R361/lib64/R# export PATH=$R_HOME/bin:$PATH - 
                        
Invoke the newly installed R-3.6.1.
# ROracle Distribution of R version 3.6.1 (--) -- "Shake and Throw" Copyright (C) The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)... 
If you still want to use the previous version of R, rename the default R executable
                                        /usr/bin/R to the old R version; for
                                example, /usr/bin/R-3.3.0:
                  
# mv /usr/bin/R /usr/bin/R-3.3.0
Now you can invoke R 3.3.0:
$ R-3.3.0
Oracle Distribution of R version 3.3.0 (--) -- "Action of the Toes"
Copyright (C) The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)...Parent topic: Administrative Tasks for Oracle Machine Learning for R