Here we will show how to install R and Rstudio. Make sure that you have Homebrew installed.

Installing R

First we need to run:

brew tap brewsci/science

Then

brew install r --cask

In ~/.zshrc add:

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Installing Rstudio

brew install rstudio --cask

Then, in order to be able to execute it from command line:

echo "alias rstudio='open -a RStudio'" >> ~/.zshrc
source ~/.zshrc

Updated: 2021-10-08