R & RStudio won't let me do *anything*

I've used R plenty in coursework before, but it's been years. Both RStudio and regular R console won't let me do anything but basic computation at the moment. I even tried deleting both programs from my Mac and redownloading--but they both still came back with all of my past data. Is there a way to completely restart my life in R? Like the first time I ever downloaded it? I'm so confused

For example, when I try to install tidyverse
*install.packages("tidyverse"), then it goes for a second and asks me if I want to download the packages that need to be compiled. I enter yes/y and then get error messages on all of the sub-packages.

Such as:

Do you want to install from sources the packages which need compilation?
y/n: y
installing the source packages ‘ps’, ‘processx’, ‘lifecycle’, ‘blob’, ‘glue’, ‘tidyselect’, ‘vctrs’, ‘callr’, ‘selectr’, ‘ellipsis’, ‘broom’, ‘dbplyr’, ‘dplyr’, ‘ggplot2’, ‘haven’, ‘hms’, ‘modelr’, ‘pillar’, ‘purrr’, ‘reprex’, ‘rlang’, ‘rvest’, ‘tibble’, ‘tidyr’, ‘xml2’, ‘tidyverse’

trying URL 'https://cran.rstudio.com/src/contrib/ps_1.3.4.tar.gz'
Content type 'application/x-gzip' length 99047 bytes (96 KB)

downloaded 96 KB

... (Many more of the same as above, all show "downloaded __ KB")

  • installing source package ‘ps’ ...
    ** package ‘ps’ successfully unpacked and MD5 sums checked
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package ‘ps’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/ps’
    Warning in install.packages :
    installation of package ‘ps’ had non-zero exit status
  • installing source package ‘glue’ ...
    ** package ‘glue’ successfully unpacked and MD5 sums checked
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package ‘glue’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/glue’
  • restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/glue’

The easiest solution would be to answer "no" to this question, you would get a precompiled binary version that is a little older but much easier to install.
If you need to install the latest version from source, then you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

Still doesn't work. This is the error message:

  • installing source package ‘ps’ ...
    ** package ‘ps’ 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 ‘ps’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/ps’
    Warning in install.packages :
    installation of package ‘ps’ had non-zero exit status

You are still trying to install from source so you need to install Xcode in your system but the error message suggest you haven't

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.