Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ArithMath-methods

Arithmetic and mathematical operations with objects of Transition* classes


Description

Standard arithmetic operators for computations with Transition* objects and numeric values. Transition objects must have the same extent and resolution. All arithmetic and mathematical operations that work on the sparse matrices are available for Transition* objects.

Usage

## S4 method for signature 'TransitionLayer,TransitionLayer'
Arith(e1, e2)

Arguments

e1

objects

e2

objects

Value

Transition* object or numeric.

Author(s)

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 TransitionLayer objects
tr1 <- transition(raster,mean,4)
tr2 <- tr1

#arithmetic operations
tr3 <- tr1 * tr2
tr4 <- tr3 * 4

#mathematical operations
tr5 <- sqrt(tr4)

gdistance

Distances and Routes on Geographical Grids

v1.3-6
GPL (>= 2)
Authors
Jacob van Etten [aut] (<https://orcid.org/0000-0001-7554-2558>), Kauê de Sousa [cre, ctb] (<https://orcid.org/0000-0002-7571-7845>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.