5
我無法在R上安裝軟件包「sf」。似乎gdal存在問題。不知道如何解決它。由於「gdal」導致安裝「sf」時遇到問題
> install.packages("sf")
There is a binary version available but the source version is later:
binary source needs_compilation
sf 0.4-3 0.5-1 TRUE
Do you want to install from sources the package which needs compilation?
y/n: y
installing the source package ‘sf’
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.5-1.tar.gz'
Content type 'application/x-gzip' length 4073881 bytes (3.9 MB)
==================================================
downloaded 3.9 MB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: clang
configure: CXX: clang++
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/3.4/Resources/library/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/1m/w_zt5ygd26n_87h41qf574wc0000gn/T/RtmpNlYbwT/downloaded_packages’
爲什麼說下載失敗,然後說源碼包已下載。是什麼賦予了?
首先,它不會說_download_失敗,而是安裝。另外,GDAL是一個C++庫,用於地理空間矢量操作,併爲R提供了一組綁定。看起來您需要使用您的軟件包管理器來安裝GDAL,然後是R的綁定,然後是這個'sf'軟件包。 –
你在Windows上嗎?我會嘗試安裝二進制文件,因爲我相信這會爲您提供gdal。 – jsta
不,在Mac上。無法通過brew安裝gdal。不知道如何解決問題。 – invictus