TRI: Compute a terrain ruggedness index following sappington et al...

Description Usage Arguments Details Author(s) Examples

Description

it returns a raster layer with the sum of the absolute values of the elevation differences between a central grid cell and its 8 neighboring cells

Usage

1
Terrain <- TRI(r1= veg_mask,gri=3,na.rm=TRUE)

Arguments

r1

is the raster layer to compute TRI from

gri

is the resolution of the grid in which TRI should be calculated. grid=3 (default) will look like this :

na.rm

whether NA cells should be computed or not.

Details

1,1,1, 1,0,1, 1.1,1 where 0 is the focal cell where the index is calculated and 1 the cells used to calculated the relative index

Author(s)

Cyril Milleret

Examples

1
2
3
4
5
6
7
8
9
 
 library(raster)
 r1 <- raster(nrows=5, ncols=5, xmn=0, xmx=10)
 r1
 values(r1) <- c(1:25)
 hey <- TRI(r1, gri=3, na.rm=TRUE)
 image(hey)
 matrix(values(r1), ncol=4, byrow=T)
 values(hey)

cyrilmi/myfunctions documentation built on May 14, 2019, 1:39 p.m.