The following summary methods are available: mean, Median, max, min, range, prod, sum, any, all

# S4 method for TransitionStack
Summary(x, ..., na.rm = FALSE)

Arguments

x

objects

...

further arguments passes to or from methods

na.rm

logical, should missing values be removed?

Value

a TransitionLayer

Note

These methods compute a summary statistic based on cell values of layers in a TransitionStack. The result of these methods is always a single TransitionLayer.

Author

Jacob van Etten

Examples

#Create a new raster and set all its values to unity.
raster <- raster(nrows=18, ncols=36)
raster <- setValues(raster,rep(1,ncell(raster)))

#Create a Transition object from the raster
tr <- transition(raster,mean,4)
#> The extent and CRS indicate this raster is a global lat/lon raster. This means that transitions going off of the East or West edges will 'wrap' to the opposite edge.
#> Global lat/lon rasters are not supported under new optimizations for 4 and 8 directions with custom transition functions. Falling back to old method.

trS <- stack(tr, tr*2)

#Apply a Summary method
trSum <- sum(trS)

#plot(raster(trMean))