Dplyr package install error

This looks like a problem with your local toolchain. There's a post (below), which suggests you install or update xcode, or xcode CLT
https://tips.tutorialhorizon.com/2015/10/01/xcrun-error-invalid-active-developer-path-library-developer-commandline-tools-missing-xcrun/