Description Usage Arguments Value References See Also Examples
This function computes the potentials as defined by J.Q. Stewart (1942).
1 2 3 
knownpts 
sp object (SpatialPointsDataFrame or SpatialPolygonsDataFrame); this is the set of known observations to estimate the potentials from. 
unknownpts 
sp object (SpatialPointsDataFrame or SpatialPolygonsDataFrame);
this is the set of unknown units for which the function computes the estimates.
Not used when 
matdist 
matrix; distance matrix between known observations and unknown
units for which the function computes the estimates. Row names match the row
names of 
varname 
character; name of the variable in the 
typefct 
character; spatial interaction function. Options are "pareto"
(means power law) or "exponential".
If "pareto" the interaction is defined as: (1 + alpha * mDistance) ^ (beta).
If "exponential" the interaction is defined as:
exp( alpha * mDistance ^ beta).
The alpha parameter is computed from parameters given by the user
( 
span 
numeric; distance where the density of probability of the spatial interaction function equals 0.5. 
beta 
numeric; impedance factor for the spatial interaction function. 
resolution 
numeric; resolution of the output SpatialPointsDataFrame (in map units). If resolution is not set, the grid will contain around 7250 points. (optional) 
mask 
sp object; the spatial extent of this object is used to create the regularly spaced SpatialPointsDataFrame output. (optional) 
bypassctrl 
logical; bypass the distance matrix size control (see

longlat 
logical; if FALSE, Euclidean distance, if TRUE Great Circle (WGS84 ellipsoid) distance. 
SpatialPointsDataFrame with the computed potentials in a new field
named OUTPUT
STEWART J.Q. (1942) "Measure of the influence of a population at a distance", Sociometry, 5(1): 6371.
rasterStewart, plotStewart, quickStewart, rasterToContourPoly, CreateGrid, CreateDistMatrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  # Create a SpatialPointsDataFrame grid of spatMask extent and 200 meters
# resolution
data(spatData)
mygrid < CreateGrid(w = spatMask, resolution = 200)
# Create a distance matrix between known points (spatPts) and mygrid
mymat < CreateDistMatrix(knownpts = spatPts, unknownpts = mygrid)
# Compute Stewart potentials from known points (spatPts) on a given
# grid (mygrid) using a given distance matrix (mymat)
mystewart < stewart(knownpts = spatPts, unknownpts = mygrid,
matdist = mymat, varname = "Capacite",
typefct = "exponential", span = 1250,
beta = 3, mask = spatMask)
# Compute Stewart potentials from known points (spatPts) on a
# grid defined by its resolution
mystewart2 < stewart(knownpts = spatPts, varname = "Capacite",
typefct = "exponential", span = 1250, beta = 3,
resolution = 200, mask = spatMask)
# The two methods have the same result
identical(mystewart, mystewart2)
# the function output a SpatialPointsDataFrame
class(mystewart)
# Computed values
summary(mystewart$OUTPUT)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.