The RStoolbox R package provides a set of high-level remote sensing tools for various remote sensing tasks. This includes unsupervised and supervised classification with different classifiers, fractional cover analysis and a spectral angle mapper. Furthermore, several spectral transformations like vegetation indices, principal component analysis or tasseled cap transformation are available as well.

Besides that a set of data import and pre-processing functions are provided. These include reading and tidying Landsat meta-data, importing ENVI spectral libraries, histogram matching, automatic image co-registration or topographic illumination correction.

RStoolbox also comes with two functions dedicated plotting commands for remote sensing data (*raster* objects) using *ggplot2* including RGB color compositing with various contrast stretching options.

RStoolbox is built on top of the *raster* package. To improve performance some functions use embedded C++ code via the *Rcpp* package.
Moreover, most functions have built-in support for parallel processing, which is activated by running raster::beginCluster() beforehand.

RStoolbox can be installed via CRAN using

[stextbox id=”info”]




List of commands:

Data Import and Export

  • `readMeta`: import Landsat metadata from MTL or XML files
  • `stackMeta`: load Landsat bands based on metadata
  • `readSLI & writeSLI`: read and write ENVI spectral libraries
  • `saveRSTBX & readRSTBX`: save and re-import RStoolbox classification objects (model and map)
  • `readEE`: import and tidy EarthExplorer search results

Data Pre-Processing

  • `radCor`: radiometric conversions and corrections. Primarily, yet not exclusively, intended for Landsat data processing. DN to radiance to reflectance conversion as well as DOS approaches
  • `topCor`: topographic illumination correction
  • `cloudMask & cloudShadowMask`: mask clouds and cloud shadows in Landsat or other imagery which comes with a thermal band
  • `classifyQA`: extract layers from Landsat 8 QA bands, e.g. cloud confidence
  • `rescaleImage`: rescale image to match min/max from another image or a specified min/max range
  • `normImage`: normalize imagery by centering and scaling
  • `histMatch`: matches the histograms of two scenes
  • `coregisterImages`: co-register images based on mutual information
  • `panSharpen`: sharpen a coarse resolution image with a high resolution image (typically panchromatic)

Data Analysis

  • `spectralIndices`: calculate a set of predefined multispectral indices like NDVI
  • `tasseledCap`: tasseled cap transformation
  • `sam`: spectral angle mapper
  • `rasterPCA`: principal components transform for raster data
  • `rasterCVA`: change vector analysis
  • `unsuperClass`: unsupervised classification
  • `superClass`: supervised classification
  • `fCover`: fractional cover of coarse resolution imagery based on high resolution classificaton

Data Display with ggplot2

  • `fortify.raster`: data.frame from raster (subsampled) for plotting
  • `ggR`: single raster layer plotting with ggplot2
  • `ggRGB`: efficient plotting of remote sensing imagery in RGB with ggplot2

Example Data Sets

  • `rlogo`: the r logo as raster brick
  • `lsat`: subset of a Landsat 5 TM scene
  • `srtm`: SRTM DEM for lsat scene


The development version is hosted at

For a more details, including executed examples, please see