Probably doing
xcode-select --install
in the Terminal app or Terminal window of RStudio will do the trick in this case. However, see also