Learn R Programming

gdistance (version 1.6.4)

Summary-methods: Summary methods

Description

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

Usage

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

Value

a TransitionLayer

Arguments

x

objects

...

further arguments passes to or from methods

na.rm

logical, should missing values be removed?

Author

Jacob van Etten

Examples

Run this code
#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)

trS <- stack(tr, tr*2)

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

#plot(raster(trMean))

Run the code above in your browser using DataLab