rasterFromTransition: RasterLayer from TransitionLayer object

Description Value Author(s) Examples

Description

Create a RasterLayer from a TransitionLayer with a call to the generic function raster.

The n x n transition matrix of the TransitionLayer is transformed to form the values n cells of a raster.

The following methods to ‘reduce’ the transition matrix are available with the optional argument reduceMethod):

The latter two methods only take into account the non-zero entries in the transition matrix.

The default is NZcolMeans.

Value

RasterLayer

Author(s)

Jacob van Etten jacobvanetten@yahoo.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#create a new raster and set all its values to unity.
r <- raster(nrows=18, ncols=36) 
r <- setValues(r,runif(ncell(r),0,1))

#create a Transition object from the raster
tr1 <- transition(r,mean,8)

#asymmetric
asf <- function(x) max(x) - x[1] + x[2]
tr2 <- transition(r,asf,8, symm=FALSE)

#create RasterLayer objects
r1 <- raster(tr1)
r2 <- raster(tr2)
r3 <- raster(tr1, "colMeans")

Example output

Loading required package: raster
Loading required package: sp
Loading required package: igraph

Attaching package: 'igraph'

The following object is masked from 'package:raster':

    union

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: Matrix

Attaching package: 'gdistance'

The following object is masked from 'package:igraph':

    normalize

gdistance documentation built on May 2, 2019, 5:46 p.m.