On a mac, the following were needed to be run in order to ensure platform dependencies are present. This should be documented in a README or an install script.
# Install libudunits2
brew install udunits
# Install gdal2
brew tap osgeo/osgeo4mac && brew tap --repair
brew install gdal2 --with-armadillo --with-complete --with-libkml --with-unsupported
echo 'export PATH="/usr/local/opt/gdal2/bin:$PATH"' >> ~/.bash_profile
# Note that inside RStudio, `gdal-config` doesn't seem to get found, even after a reboot, even though it is present at `/usr/local/opt/gdal2/bin/`
# sf should then install fine.
On a mac, the following were needed to be run in order to ensure platform dependencies are present. This should be documented in a README or an install script.