I have just downloaded RStudio and installed the two packages clang.7.0.0 and gfortran-6.1.pkg on my Mac (iOS Catalina) 10.15. However, when trying to install any further package in RStudio I seem to run into the same error again and again. What do I need to do in order for it to work? The following code is for Rcpp because this is the first package I wanted to install in order to be able to import excel data sets.
Here's the code:
> install.packages('Rcpp') There is a binary version available but the source version is later: binary source needs_compilation Rcpp 1.0.3 1.0.4 TRUE Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes installing the source package ‘Rcpp’ versuche URL 'https://cran.rstudio.com/src/contrib/Rcpp_1.0.4.tar.gz' Content type 'application/x-gzip' length 2750216 bytes (2.6 MB) ================================================== downloaded 2.6 MB * installing *source* package ‘Rcpp’ ... ** Paket ‘Rcpp’ erfolgreich entpackt und MD5 Summen überprüft ** using staged installation ** libs clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c api.cpp -o api.o clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot] In file included from api.cpp:24: In file included from ../inst/include/Rcpp.h:27: In file included from ../inst/include/RcppCommon.h:29: In file included from ../inst/include/Rcpp/r/headers.h:67: In file included from ../inst/include/Rcpp/platform/compiler.h:100: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:305: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/math.h:301:15: fatal error: 'math.h' file not found #include_next <math.h> ^~~~~~~~ 1 error generated. make: *** [api.o] Error 1 ERROR: compilation failed for package ‘Rcpp’ * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp’ Warning in install.packages : installation of package ‘Rcpp’ had non-zero exit status The downloaded source packages are in ‘/private/var/folders/g7/32_t5f316770d0s3z9qdv1tc0000gp/T/RtmpdGAQZj/downloaded_packages’
I have just started with R as my uni has shut down due to Covid-19 and I cannot use STATA anymore – and probably won't any longer once I have mastered R. For that I seem to really need your help and I would very much appreciate it!!!