Thank you andresrcs and jlacko!
I have installed the GDAL package using Brew, and it's version is:
gdalinfo --version
GDAL 3.2.1, released 2020/12/29
Below is the code output I get when trying to install sf and tmap packages. Is there anything else I should check?
Show in New Window
** Installing R Packages: 'sf', 'tmap'
[1/5] Installing sf...
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘sf’
installing the source package ‘sf’
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-7.tar.gz'
Content type 'application/x-gzip' length 4203095 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/sf’
[2/5] Installing tmaptools...
The downloaded source packages are in
‘/private/var/folders/kt/wk55fndj0d7ch9gzjzy1f1mw0000gn/T/RtmppOg7n9/downloaded_packages’
also installing the dependencies ‘sf’, ‘lwgeom’, ‘stars’
Packages which are only available in source form, and may need
compilation of C/C++/Fortran: ‘sf’ ‘lwgeom’
installing the source packages ‘sf’, ‘lwgeom’, ‘stars’, ‘tmaptools’
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-7.tar.gz'
Content type 'application/x-gzip' length 4203095 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/lwgeom_0.2-5.tar.gz'
Content type 'application/x-gzip' length 501653 bytes (489 KB)
==================================================
downloaded 489 KB
trying URL 'https://cran.rstudio.com/src/contrib/stars_0.5-1.tar.gz'
Content type 'application/x-gzip' length 5046980 bytes (4.8 MB)
==================================================
downloaded 4.8 MB
trying URL 'https://cran.rstudio.com/src/contrib/tmaptools_3.1-1.tar.gz'
Content type 'application/x-gzip' length 40116 bytes (39 KB)
==================================================
downloaded 39 KB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/sf’
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/lwgeom’
ERROR: dependencies ‘sf’, ‘lwgeom’ are not available for package ‘stars’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/stars’
[3/5] Installing stars...
ERROR: dependencies ‘sf’, ‘lwgeom’, ‘stars’ are not available for package ‘tmaptools’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tmaptools’
The downloaded source packages are in
‘/private/var/folders/kt/wk55fndj0d7ch9gzjzy1f1mw0000gn/T/RtmppOg7n9/downloaded_packages’
also installing the dependencies ‘sf’, ‘lwgeom’
Packages which are only available in source form, and may need
compilation of C/C++/Fortran: ‘sf’ ‘lwgeom’
installing the source packages ‘sf’, ‘lwgeom’, ‘stars’
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-7.tar.gz'
Content type 'application/x-gzip' length 4203095 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/lwgeom_0.2-5.tar.gz'
Content type 'application/x-gzip' length 501653 bytes (489 KB)
==================================================
downloaded 489 KB
trying URL 'https://cran.rstudio.com/src/contrib/stars_0.5-1.tar.gz'
Content type 'application/x-gzip' length 5046980 bytes (4.8 MB)
==================================================
downloaded 4.8 MB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/sf’
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/lwgeom’
[4/5] Installing leafem...
ERROR: dependencies ‘sf’, ‘lwgeom’ are not available for package ‘stars’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/stars’
The downloaded source packages are in
‘/private/var/folders/kt/wk55fndj0d7ch9gzjzy1f1mw0000gn/T/RtmppOg7n9/downloaded_packages’
also installing the dependency ‘sf’
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘sf’
installing the source packages ‘sf’, ‘leafem’
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-7.tar.gz'
Content type 'application/x-gzip' length 4203095 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/leafem_0.1.3.tar.gz'
Content type 'application/x-gzip' length 3047855 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/sf’
[5/5] Installing tmap...
ERROR: dependency ‘sf’ is not available for package ‘leafem’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/leafem’
The downloaded source packages are in
‘/private/var/folders/kt/wk55fndj0d7ch9gzjzy1f1mw0000gn/T/RtmppOg7n9/downloaded_packages’
also installing the dependencies ‘lwgeom’, ‘tmaptools’, ‘sf’, ‘stars’, ‘leafem’
Packages which are only available in source form, and may need
compilation of C/C++/Fortran: ‘lwgeom’ ‘sf’
installing the source packages ‘lwgeom’, ‘tmaptools’, ‘sf’, ‘stars’, ‘leafem’, ‘tmap’
trying URL 'https://cran.rstudio.com/src/contrib/lwgeom_0.2-5.tar.gz'
Content type 'application/x-gzip' length 501653 bytes (489 KB)
==================================================
downloaded 489 KB
trying URL 'https://cran.rstudio.com/src/contrib/tmaptools_3.1-1.tar.gz'
Content type 'application/x-gzip' length 40116 bytes (39 KB)
==================================================
downloaded 39 KB
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-7.tar.gz'
Content type 'application/x-gzip' length 4203095 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/stars_0.5-1.tar.gz'
Content type 'application/x-gzip' length 5046980 bytes (4.8 MB)
==================================================
downloaded 4.8 MB
trying URL 'https://cran.rstudio.com/src/contrib/leafem_0.1.3.tar.gz'
Content type 'application/x-gzip' length 3047855 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
trying URL 'https://cran.rstudio.com/src/contrib/tmap_3.3.tar.gz'
Content type 'application/x-gzip' length 3120127 bytes (3.0 MB)
==================================================
downloaded 3.0 MB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/sf’
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/lwgeom’
ERROR: dependency ‘sf’ is not available for package ‘leafem’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/leafem’
ERROR: dependencies ‘sf’, ‘lwgeom’ are not available for package ‘stars’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/stars’
ERROR: dependencies ‘sf’, ‘lwgeom’, ‘stars’ are not available for package ‘tmaptools’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tmaptools’
ERROR: dependencies ‘tmaptools’, ‘sf’, ‘stars’, ‘leafem’ are not available for package ‘tmap’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tmap’
The downloaded source packages are in
‘/private/var/folders/kt/wk55fndj0d7ch9gzjzy1f1mw0000gn/T/RtmppOg7n9/downloaded_packages’
✔ Packages successfully installed.
There were 16 warnings (use warnings() to see them)