I'm working on a Linux server with RStudio open-source. Right now, my admins have the default version of R set in the rserver.conf as follows:
# Point To 3.5.3
rsession-which-r=/opt/R/R-3.5.3/bin/R
Suppose they were to remove that setting and restart the server. Then, as I understand from reading the documentation, "RStudio uses the version of R pointed to by the output of the following command: which R
" .
Interestingly, running which R
produces the following:
alias R='/opt/rVersionSelect.sh'
/opt/rVersionSelect.sh
The script for rVersionSelect.sh is the following:
#!/bin/bash
RDIR=/opt/R
echo "Available Versions:"
echo "------------------------"
for rVer in $RDIR/* ; do
echo $(echo $rVer | cut -d- -f2)
done
read -n 5 -p "Enter The R Version You'd Like To Run: " RunThisVersion
if [ -d $RDIR/R-$RunThisVersion/ ] ; then
echo "Loading $RunThisVersion...."
wait 10
clear
$RDIR/R-$RunThisVersion/bin/R --interactive
else
echo "Unrecognized Version: $RunThisVersion"
fi
When in the Linux Terminal, this effectively allows the user to choose which of multiple versions of R they want to run.
If the default version of R were removed by unsetting rsession-which-r
, would users be able to choose which version of R they wanted to run within RStudio's console?
The document I referred to earlier says "The which
command performs a search for the R executable using the system PATH. RStudio will therefore by default bind to the same version that is run when R is executed from a terminal." Without a specific version of R referenced in the system PATH and without setting rsession-which-r
, where does RStudio go next to determine the default version of R?