Install Homebrew (if needed)

ruby -e "$(curl -fsSL \
https://raw.github.com/Homebrew/homebrew/go/install)"

Install R

brew tap homebrew/science
brew install r