Update R.sh

This commit is contained in:
spiritLHLS 2023-04-01 18:51:26 +08:00 committed by GitHub
parent f49275cf22
commit 6aafaebfeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

28
R.sh
View File

@ -54,27 +54,27 @@ checkroot(){
} }
checkR(){ checkR(){
if ! command -v R &> /dev/null # if ! command -v R &> /dev/null
then # then
reading "R is not installed on this system. Do you want to install it? (y/n) " confirminstall # reading "R is not installed on this system. Do you want to install it? (y/n) " confirminstall
echo "" # echo ""
if [ "$confirminstall" != "y" ]; then # if [ "$confirminstall" != "y" ]; then
exit 0 # exit 0
fi # fi
echo "R is not installed, install R language and dependent libraries..." # echo "R is not installed, install R language and dependent libraries..."
${PACKAGE_INSTALL[int]} r-base libssl-dev libcurl4-openssl-dev libxml2-dev # ${PACKAGE_INSTALL[int]} r-base libssl-dev libcurl4-openssl-dev libxml2-dev
else # else
echo "R is already installed, skip..." # echo "R is already installed, skip..."
fi # fi
if ! R -q -e "library('IRkernel')" &> /dev/null source activate jupyter-env
if ! Rscript -e "IRkernel::installspec()" &>/dev/null; then
then then
reading "IRkernel is not installed on this system. Do you want to install it? (y/n) " confirminstall reading "IRkernel is not installed on this system. Do you want to install it? (y/n) " confirminstall
echo "" echo ""
if [ "$confirminstall" != "y" ]; then if [ "$confirminstall" != "y" ]; then
exit 0 exit 0
fi fi
source activate jupyter-env
conda install -c r r-irkernel conda install -c r r-irkernel
green "Installed IRkernel package and registered kernel" green "Installed IRkernel package and registered kernel"
else else