You need to install gfortran before R.
$ brew install gfortranYou might find that you don't have XQuartx. Please download and install it at https://xquartz.macosforge.org.
$ brew install R
Unsatisfied dependency: XQuartz
Homebrew does not package XQuartz. Installers may be found at:
https://xquartz.macosforge.org
Error: An unsatisfied requirement failed this build.
After you install XQuartz, you can install R like this:
$ brew install R