Learn R Programming

rWind (version 0.3.0)

flow.dispersion: Flow dispersion

Description

flow.dispersion computes movement conductance through a flow either, sea or wind currents. It implements the formula described in Felicisimo et al. 2008:

Cost=(1/Speed)*(HorizontalFactor)

being HorizontalFactor a "function that incrementaly penalized angular deviations from the wind direction" (Felicisimo et al. 2008). The function returns conductance values (1/cost) to move betwen all cells in a raster having into account flow speed and direction obtained from wind.fit function("rWind" package). As wind or sea currents implies directionality, flow.dispersion produces an anisotropic conductance matrix (asimetric). Conductance values are used later to built a TransitionLayer object from "gdistance" package.

Usage

flow.dispersion(dl,sl,type="passive", output="raw")

Arguments

dl

Direction layer. Raster layer obtained from wind2raster function ("rWind" package) with flow direction values.

sl

Speed layer. Raster layer obtained from wind2raster function ("rWind" package) with flow speed values.

type

Could be either "passive" or "active".In "passive" mode, movement cannot go against flow direction (it doesn't allow HorizontalFactor higher than 90). In "active" mode, the movement can go against flow direction, by increasing the cost.

output

This argument allows to select diferent kinds of output. "raw" mode creates a matrix (class "dgCMatrix") with transition costs between all cells in the raster. "transitionLayer" creates a TransitionLayer object with conductance values to be used with "gdistance" package.

Value

A TransitionLayer object from "gdistance" package that could be used to compute least cost paths.

Details

flow.dispersion creates a sparse Matrix with conductance values (1/cost).

References

Felic<U+00ED>simo, <U+00C1>. M., Mu<U+00F1>oz, J., & Gonz<U+00E1>lez-Solis, J. (2008). Ocean surface winds drive dynamics of transoceanic aerial movements. PLoS One, 3(8), e2928.

van Etten, J. (2012). gdistance: Distances and routes on geographical grids. R package version 1.1<U+2013>4. Available a t CRAN. R-project. org/package= gdistance.

See Also

wind.fit, wind2raster

Examples

Run this code
# NOT RUN {
require(gdistance)

# w<-wind.dl(2015,2,12,0,-10,5,35,45)

data(wind_data)
w<-wind.fit(wind_data)

dl<-wind2raster(w)
sl<-wind2raster(w, type="speed")

Conductance<-flow.dispersion(dl,sl,"passive", "transitionLayer")

transitionMatrix(Conductance)
image(transitionMatrix(Conductance))

# }

Run the code above in your browser using DataLab