Learn R Programming

eseis (version 0.6.0)

spatial_clip: Clip values of spatial data.

Description

The function replaces raster values based on different thresholds.

Usage

spatial_clip(data, quantile, replace = NA, normalise = TRUE)

Value

raster object, data set with clipped values.

Arguments

data

raster object, spatial data set to be processed.

quantile

Numeric value, quantile value below which raster values are clipped.

replace

Numeric value, replacement value, default is NA.

normalise

Logical value, optionally normalise values above threshold quantile between 0 and 1. Default is TRUE.

Author

Michael Dietze

Examples

Run this code

## load example data set
data(volcano)

## convert matrix to raster object
volcano <- raster::raster(volcano)

## clip values to those > quantile 0.5
volcano_clip <- spatial_clip(data = volcano, 
                                    quantile = 0.5)
                                    
## plot clipped data set
raster::plot(volcano_clip)
                     

Run the code above in your browser using DataLab