Can't install any packages in R

How did you install R? If you installed the r formula from Homebrew, then I suggest you remove it and install the CRAN build of R, which can use the binary packages from CRAN. You can also do this from Homebrew by installing the r cask:

brew install --cask r

Or, a great way to do that is to use the rig tool [1]. Which you can also install via Homebrew, btw.

To compile packages from source (which you rarely need with the CRAN build of R), you might need to install the XCode command line tools. You do not need to install gcc from Homebrew, CRAN R is configured

(Btw. if you add more specific tags to your question, e.g. "package installation" in this case, then there is a much higher chance that the people who can help you will see your question.)

[1] GitHub - r-lib/rig: The R Installation Manager

1 Like