View source: R/wind_functions2.R
| flow.dispersion_int | R Documentation |
flow.dispersion_int computes movement conductance through a flow such as sea or wind currents. Passive movement uses a restricted version of the formula described in Felícisimo et al. (2008):
flow.dispersion_int(
stack,
fun = cost.FMGS,
output = "transitionLayer",
type = c("passive", "active"),
speed.scale = NULL,
...
)
stack |
A |
fun |
A function to compute the cost to move between cells. The default
is |
output |
This argument allows to select different 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. |
type |
Movement model: |
speed.scale |
Positive reference speed for the active model. If |
... |
Further arguments passed to or from other methods. |
Cost=(1/Speed)*(HorizontalFactor)
where HorizontalFactor incrementally penalizes angular deviations from the flow direction and prevents passive movement at deviations of 90 degrees or more. Active movement instead uses the signed flow component parallel to the movement direction; supportive flow lowers cost and opposing flow raises it.
With output = "transitionLayer", a gdistance::TransitionLayer
whose sparse matrix stores directed conductances (1/cost) between the eight
neighbouring cells. With output = "raw", a sparse matrix of class
dgCMatrix containing edge costs. Rows index origins and columns index
destinations. Each edge cost averages local costs at both cells and is
multiplied by sqrt(2) for diagonal moves. In the raw matrix, Inf marks
forbidden neighbouring moves; zeros represent absent edges, not free moves.
In the conductance matrix, forbidden moves have zero conductance.
Costs are relative per grid step. The diagonal correction assumes a square grid, but no correction is made for the changing physical distances of longitude/latitude cells. Results should not be interpreted as physical time, energy, or distance and should not be compared directly across grid resolutions or distant latitude ranges.
Note that for large data sets, it could take a while. For large study areas is strongly advised perform the analysis in a remote computer or a cluster.
Javier Fernández-López; Klaus Schliep; Yurena Arjona
Felicísimo, Á. M., Muñoz, J., & González-Solis, J. (2008). Ocean surface winds drive dynamics of transoceanic aerial movements. PLoS One, 3(8), e2928.
Jacob van Etten (2017). R Package gdistance: Distances and Routes on Geographical Grids. Journal of Statistical Software, 76(13), 1-21. doi:10.18637/jss.v076.i13
wind.dl, wind2raster
data(wind.data)
wind <- wind2raster(wind.data)
Conductance <- flow.dispersion(wind, type = "passive")
conductance_matrix <- gdistance::transitionMatrix(Conductance)
conductance_matrix[1:6, 1:6]
Matrix::image(conductance_matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.