Mapping with R on Mac: Installation

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew unlink gdal
brew tap osgeo/osgeo4mac && brew tap --repair
brew install proj
brew install geos
brew install udunits
brew install gdal2 --with-armadillo --with-complete --with-libkml --with-unsupported
brew link --force gdal2
$ gdal-config --version
2.3.1
$ gdal-config --libs
-L/usr/local/Cellar/gdal2/2.3.1/lib -lgdal
$ gdal-config --cflags
-I/usr/local/Cellar/gdal2/2.3.1/include

Step 3: Install packages

install.packages("sf")
install.packages("raster")
install.packages("spData")
install.packages("spDataLarge", repos = "https://nowosad.github.io/drat/",type = "source")
library(sf)         
library(raster)
library(spData)
library(spDataLarge)

Data + Design + Code

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jin

Jin

Data + Design + Code

More from Medium

Map Insights in Tableau Software

eye-catching density plots in R

Data Visualization in R using ‘ggplot’ — Part 1

TidyTuesday — May 03 2022