Error When Installing the Command Line Developer Tools on Mac

This is a macOS specific issue (not directly related to R), you could try the solution on this related thread.