error installing 'rgdal', 'sf', 'stars' packages in R in MacOS version 12.5.1

Hello! I have macOS Monterrey and I am unable to download certain packages for spatial analysis (rgdal, sf, stars).
I would appreciate some advice regarding the error I get. Part of the error code is below:

configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘sf’

  • removing ‘/Users/carlamere/Library/R/x86_64/4.2/library/sf’
  • restoring previous ‘/Users/carlamere/Library/R/x86_64/4.2/library/sf’
    Warning in install.packages :
    installation of package ‘sf’ had non-zero exit status
  • installing source package ‘stars’ ...
    ** package ‘stars’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** demo
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error: package ‘sf’ 1.0.7 was found, but >= 1.0.8 is required by ‘stars’
    Execution halted
    ERROR: lazy loading failed for package ‘stars’
  • removing ‘/Users/carlamere/Library/R/x86_64/4.2/library/stars’
    Warning in install.packages :
    installation of package ‘stars’ had non-zero exit status

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.