I installed R from official cran website and i can run R from the Rstudio but when i try to use R from the terminal, I get the following results:
(base) ege@Eges-MBP ~ % R
zsh: command not found: R
(base) ege@Eges-MBP ~ % RScript
zsh: command not found: RScript
How can i enable the command R and run RScript from terminal on my mac?
This is possibly due to a bug with the current version of CRAN's R installation package (present as of version 4.0.5), that affects certain versions of Big Sur. I've answered this question here: R: command not found
In short, if running uname -r
gives you a release number greater than 20, then you may need to manually create symbolic links that the package installer failed to.
In short:
sudo -s
mkdir -p /usr/local/bin
cd /usr/local/bin
rm -f R Rscript
ln -s /Library/Frameworks/R.framework/Resources/bin/R .
ln -s /Library/Frameworks/R.framework/Resources/bin/Rscript .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With