rsMove (version 0.2.1)

specVar: specVar

Description

Quantifies how changes in the resolution of a raster affects the perception of spectral complexity.

Usage

specVar(img = img, xy = NULL, pxr = pxr)

Arguments

img

Object of class RasterLayer.

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

pxr

vector of target resolutions.

Value

A list.

Details

Given a raster object, the function determines how reducing the resolution of the raster impacts our ability to perceive the complexity of the landscape. The function aggregates img to each of the given pixel resolutions (pxr) and estimates the Mean Absolute Error (MAE) for each pixel with the aggregated layer where the differences are estimated from the pixel within the original raster that overlap with the target pixel. If a point shapefile is provided (xy), the function will only report on the values that overlap with the points. The output of the function consists of:

  • mae - MAE, either for all pixels or for the points within xy

  • pixel.optimal - raster reporting on the resolution with the lowest MAE for each pixel

  • pixel.optimal.stats - Proportion of samples per resolution derived from pixel.optimal

  • plot - boxplots of the variability of the MAE per resolution

If xy is set, the output will contain a vector with the optimal resolution per sample ($sample.optimal).

See Also

tMoveRes sMoveRes

Examples

Run this code
# NOT RUN {
 require(raster)

 # read raster data
 r <- raster(system.file('extdata', 'tcb_1.tif', package="rsMove"))

 # read movement data
 moveData <- read.csv(system.file('extdata', 'konstanz_20130804.csv', package="rsMove"))
 moveData <- SpatialPointsDataFrame(moveData[,1:2], moveData, proj4string=crs(r))

 # apply function
 s.var <- specVar(img=r, xy=moveData, pxr=60)

# }

Run the code above in your browser using DataLab