Back

rspatial-env

rspatial-env

Description

This is an convinience module for loading easily spatial analysis related R tools. It loads the following software:

  • R (3.5.0, 3.4.3, 3.4.1) with spatial packages:
    • geoR - geostatistical analysis including traditional, likelihood-based and Bayesian methods.
    • geoRglm - functions for inference in generalised linear spatial models, extension to the geoR package.
    • geosphere - spherical trigonometry for geographic coordinates (lat, lon).
    • ggmap - map visualizations with ggplot2. As background map various online sources can be ued (e.g Google Maps and Stamen Maps). It includes tools also for geocoding and routing.
    • gstat - spatial and spatio-temporal geostatistical modelling, prediction and simulation. Variogram modelling; simple, ordinary and universal point or block (co)kriging; spatio-temporal kriging; sequential Gaussian or indicator (co)simulation; variogram and variogram map plotting utility functions.
    • GWmodel - geographically-weighted models: GW summary statistics, GW principal components analysis, GW discriminant analysis and various forms of GW regression.
    • lidR - LiDAR data manipulation and visualization (for forestry applications), computation of metrics in area based approach, point filtering, artificial point reduction, classification from geographic data, normalization, individual tree segmentation and other manipulations.
    • mapedit - interactive editing of sf objects
    • maptools
    • mapview - quickly and conveniently create interactive visualisations of spatial data with or without background maps. Attributes of displayed features are fully queryable via pop-up windows.
    • ncdf4 - read, write and modify NetCDF-files.
    • RandomFields - simulation and analysis of random fields.
    • raster - main package for raster data.
    • rgdal - bindings to GDAL and PROJ4 libraries, for basic data reading and writing.
    • rgeos - binding to GEOS library, for topology operations on geometries.
    • rgrass7 - for using all 'GRASS 7' commands from R.
    • rlas - read and write 'las' and 'laz' file formats.
    • RSAGA - for using SAGA GIS commands from R.
    • sf - main package for vector data, bindings to GDAL, GEOS and PROJ4 libraries. Works with tidyverse packages. Similar functionality, but newer and better than sp.
    • sp - older main package for vector data.
    • spacetime - for working with spatio-temporal data.
    • spatial - for kriging and point pattern analysis.
    • spatial.tools - to enhance the core functionality of the package "raster", including a parallel processing engine for use with rasters.
    • spdep - spatial dependence: weighting schemes, statistics and models.
    • spatstat - for analysing point patterns.
    • viridis - color maps for map plotting.
  • GDAL/OGR (2.2.1)
  • GEOS (3.6.1)
  • GRASS GIS (7.2.0, without GUI)
  • Proj4 (4.9.3)
  • Saga GIS (5.0.0 for R 3.5.0, 2.1.4 for older R versions)

Some R packages like raster and spatial.tools packages include functions that support parallel computing. There is an example of using predict function from raster package in parallel amoung our examples. If you want to use spatial.tools package, please ask for extra guidelines from CSC servicedesk.

The other option is to write R code using R packages for parallel computing (snow, doMPI, etc). Some basic guidelines are given on basic R page. There is also an example of using RSAGA contour function together with snow package amoung our examples.


Available

Version on CSC's Servers

Taito: 3.4.1, 3.4.3, 3.5.0


Usage

If you want to use Saga GIS or RStudio with GUI, you should connect to taito-shell using -X connection or NoMachine for Windows users.

In Taito and Taito-shell, to load:

module load rspatial-env

Please note that execution of the command unloads all current modules. Thus, if your R session depends on some atypical modules, these need to be set up following the R-enviroment startup.

For more documentation is available from the general R page, inc. usage of batch jobs.

Example for submitting jobs to Taito using R and spatial packages can be found from here.

Comments:

  • Rstudio in NoMachine, you can open RStudio with spatial packeges in NoMachine from the Fluxbox menu: Applications -> Taito-shell -> GIS -> RStudio for GIS. The Rstudio under Mathematics menu does not include the spatial packages.
    • You can achive the same also with loading rspatial-env and rstudio modules and opening Rstudio.
module load rspatial-env rstudio
rstudio
  • RSAGA:
    • RSAGA gives error messages: "Error: select a tool", but it seems to be a bug of SAGA. According to our tests it seems that RSAGA commands are working despite the message.
    • RSAGA io_gdal library does not work with rspatial-env, because of GDAL versions confict. Please try to use rgdal functions if possible. If that is not suitable solution, it is possible to use SAGA with older versions of GDAL and R, but then the list of pre-loaded R spatial packages and supported GDAL tools and formats is more limited.
module load r-env/2.2.1 geos/3.4.2 proj4/4.9.1 gdal/1.11.1 wxwidgets saga/2.1.4


Discipline

Geosciences

References


Support


Manual

A lot of materials about using R for spatial analysis are available: