I’m running MacOS Ventura 13.6.7. I want to install the nlme R package using RStudio, which requires compilation. When I try to install it, I get the following error:
installing the source package ‘nlme’
trying URL 'https://cran.rstudio.com/src/contrib/nlme_3.1-165.tar.gz'
Content type 'application/x-gzip' length 856244 bytes (836 KB)
==================================================
downloaded 836 KB
* installing *source* package ‘nlme’ ...
** package ‘nlme’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -mmacosx-version-min=10.13 -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c chol.f -o chol.o
make: gfortran: No such file or directory
make: *** [chol.o] Error 1
ERROR: compilation failed for package ‘nlme’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/nlme’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/nlme’
Warning in install.packages :
installation of package ‘nlme’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/p2/2rwngv010yx_0mxq1yd573zm0000gn/T/RtmpXRKSJE/downloaded_packages’
I have downloaded and installed gfortran from this link: https://mac.r-project.org/tools/gfortran-12.2-universal.pkg.
It is installed here: /opt/gfortran/bin/gfortran
However, I’m still getting the error.
New contributor
Tomisin Adebari is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.