This function calculates the weighted distance moved by a mass represented by set of cells which fall north, south, east, or west of a given location (i.e., typically the centroid of the starting population). Values >0 confer movement to the north, south, east, or west of this location.
.cardinalDistance(
direction,
longOrLat,
coordVect,
x1,
x2,
refCoord,
x1weightedLongs,
x1weightedLats,
x2weightedLongs,
x2weightedLats,
x1weightedElev = NULL,
x2weightedElev = NULL
)
A list object with distance moved and abundance of all cells north/south/east/west of reference point.
Any of: 'n'
(north), 's'
(south), 'e'
(east), or 'w'
(west).
Numeric matrix, latitude or longitudes. If direction
is 'n'
or 's'
this must be latitudes. If direction
is 'e'
or 'w'
this must be longitudes.
Vector of latitude or longitude of cell centers, depending on value of longOrLat
. If latitude, these must go from south to north. If longitude
, these must go from west to east.
Matrix of weights in time 1 (i.e., population size).
Matrix of weights in time 2 (i.e., population size).
Numeric, latitude or longitude (depending on longOrLat
) of reference point from which to partition the weights into a northern, southern, eastern, or western portion.
Matrix of longitudes weighted (i.e., by population size, given by x1
).
Matrix of latitudes weighted (i.e., by population size, given by x1
).
Matrix of longitudes weighted (i.e., by population size, given by x2
).
Matrix of latitudes weighted (i.e., by population size, given by x2
).
Matrix of elevations weighted by x1 or NULL
.
Matrix of elevations weighted by x2 or NULL
.