rgdal not installing in R? "non-zero exit status?"

Viewed 215

I am trying to install the package rgdal on a new MacOS 12.2.1. I have the newest version of R, and it has not been working much to my frustration. When I use the command "install.packages("rgdal")," a prompt is displayed: "Do you want to install from sources the package which needs compilation? (Yes/no/cancel)" I've tried this multiple times, selecting both yes and no, because I really have no idea what this prompt even means. Anyways, R downloads a bunch of necessary packages with no problem, but then when it gets to the end of the downloading process, this displays:

configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rgdal’
* restoring previous    ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rgdal’

The downloaded source packages are in
    ‘/private/var/folders/t5/dqf_shjn2v79xfnycl1thkxh0000gn/T/Rtmpz3gATu/downloaded_packages’
Warning message:
In install.packages("rgdal") :
  installation of package ‘rgdal’ had non-zero exit status

I have no idea what this means! I'm tired, confused, upset, I have little experience with coding at all and yeah this is just not an ideal situation! If anyone with more experience with R understands what is happening, I'd love help! Thank you!

0 Answers
Related