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

30
R.sh
View File

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