Learn R Programming

ctmcmove (version 1.2.1)

rast.grad: Creates gradient rasters from a raster object.

Description

This function takes a raster stack or raster object and creates two matrices for each raster layer, one which contains the x coordinates of the gradient of the raster layer and one which contains the y coordinates of the gradient of the raster layer.

Usage

rast.grad(rasterstack)

Arguments

rasterstack
A raster layer or raster stack from package "raster".

Value

  • xyA matrix of x and y coordinates of each cell in the raster stack or raster layer. The order is the order of the cells in the raster object.
  • grad.xa matrix where each column is the x-coordinates of the gradient for one raster layer
  • grad.ya matrix where each column is the y-coordinates of the gradient for one raster layer
  • rast.grad.xA raster stack where each raster layer is the x-coordinates of the gradient for one covariate
  • rast.grad.yA raster stack where each raster layer is the x-coordinates of the gradient for one covariate

Details

The gradient is computed using the "terrain" function in raster.

References

Hanks, E. M.; Hooten, M. B. & Alldredge, M. W. Continuous-time Discrete-space Models for Animal Movement The Annals of Applied Statistics, 2015, 9, 145-165

Examples

Run this code
## For example code, do
##
## > help(ctmcMove)

Run the code above in your browser using DataLab