Geospatial packages in R such as rgdal and sf cannot be installed. Is there a work-around?

Support for geospatial R packages on the RCE is currently shaky at best. There are work-arounds, but they can be error-prone and are easy to break. You may wish to use another system for your geospatial work in R for the time being. Read on if you wish to try some work-arounds in order to install and run rgdal and other geospatial R packges on the RCE.

The basic issue The system GDAL library is too old, but cannot be updated beause other software depends on it. As a work-around we compiled GDAL 2.1.1 and made it available at

/nfs/tools/apps/gdal/2.1.1

To install rgdal, start an RCE Powered Terminal and setup your PATH and LD_LIBRARY_PATH as shown below:

export PATH=/nfs/tools/apps/gdal/2.1.1/bin:$PATH
export LD_LIBRARY_PATH=/nfs/tools/apps/gdal/2.1.1/lib:$LD_LIBRARY_PATH

then run R or rstudio and install rgdal in R as shown below:

install.packages("rgdal")

Configuring your environment as shown above may also enable installation of sf and other geospatial R packages but this has not been tested.