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.

1 | ```
rast.grad(rasterstack)
``` |

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

`xy` |
A 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.x` |
a matrix where each column is the x-coordinates of the gradient for one raster layer |

`grad.y` |
a matrix where each column is the y-coordinates of the gradient for one raster layer |

`rast.grad.x` |
A raster stack where each raster layer is the x-coordinates of the gradient for one covariate |

`rast.grad.y` |
A raster stack where each raster layer is the x-coordinates of the gradient for one covariate |

Ephraim M. Hanks

1 2 3 | ```
## For example code, do
##
## > help(ctmcMove)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.