Install sf and spdep from source in MacOSX
I had problem to install new version of spdep from source. I get this answer from maintainer of the package:
This is not an spdep issue. See r-spatial/sf#1848, and the resolution of never installing from source unless you know how to do it and need to do it to access the development versions of packages, or more recent versions of external software.
I don't agree at all with this answer. When you build a package from source, it is exactly fitted for your configuration.
Here is the solution:
In terminal
brew install gdal
brew install proj
brew install geos
brew install sqlite3
or
brew reinstall ***
in R with intel processor
install.packages("sf",configure.args = "--with-gdal-config=/usr/local/bin/gdal-config", type="source")
install.packages("spdep",configure.args = "--with-gdal-config=/usr/local/bin/gdal-config", type="source")
And it works
In R with ARM64 processor
install.packages("sf", type = "source", configure.args = c("--with-gdal-config=/opt/homebrew/opt/gdal/bin/gdal-config", "--with-sqlite3-lib=/opt/homebrew/opt/sqlite/lib", "--with-proj-lib=/opt/homebrew/opt/proj/lib"))
install.packages("spdep", type = "source", configure.args = c("--with-gdal-config=/opt/homebrew/opt/gdal/bin/gdal-config", "--with-sqlite3-lib=/opt/homebrew/opt/sqlite/lib", "--with-proj-lib=/opt/homebrew/opt/proj/lib"))
Commentaires
Enregistrer un commentaire