I am having trouble with installing the package caret. I have seen it has been a common issue for several users, but I get a different error than most of them, who needed to install the dependencies.
The R version I am using is R.4.0.4
Here is the error I get:
* installing *source* package ‘caret’ ...
** package ‘caret’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘caret’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/caret’
Warning in install.packages :
installation of package ‘caret’ had non-zero exit status
How do I resolve this error?