aspace (version 0.1)

calc.sde: Calculate and plot a Standard Deviation Ellipse

Description

This function computes the Standard Deviation Ellipse (SDE) for a set of points. The SDE is a centrographic measure used to characterize the dispersion of point observations along two orthogonal axes. The SDE also captures directional bias in aspatial point pattern and will be oriented in the direction of maximum dispersion. The function provides options for weighting observations, and centring the ellipse on a user defined point, mean centre, or weighted mean centre of the input point locations. Output includes plotting of the SDE and an ASCII (text) file containing elliptical coordinates.

Usage

calc.sde(id = 1, filename = "SDE_Output.txt", calccentre = FALSE, useWMC = FALSE, centre.xy = centre, destmat = activities, titletxt = "Title", verbose = FALSE, plot = TRUE, calcSDxy = TRUE, plotSDEaxes = TRUE, plotdest = TRUE, plotcentroid = TRUE, plotSDxy = TRUE, weightpoints = FALSE, weights = wts, jpeg = FALSE)

Arguments

id
An identifier for a given SDE. When running calc.sde in a loop for multiple sets of points, increment id such that it is unique!
filename
The name of an ASCII (text) file where SDE coordinates will be written
calccentre
Boolean: Set to TRUE if the mean center of the points is to be used as the SDE centroid
useWMC
Boolean: Set to TRUE if the weighted mean center is to be used as the SDE centroid
centre.xy
A numeric vector of length 2, containing specified x- and y-coordinates to use as the centroid
destmat
A numeric matrix or data frame with two columns. The first column represents x-coordinates, the second, y-coordinates. Each row corresponds to a single point location.
titletxt
A string to use as the title on the plot
verbose
Boolean: Set to TRUE if extensive standard output feedback is desired
plot
Boolean: Set to TRUE if the SDE is to be plotted
calcSDxy
Boolean: Set to TRUE if the standard deviations in the orthogonal (x and y) directions are to be computed
plotSDEaxes
Boolean: Set to TRUE if the orthogonal axes through the centroid are to be plotted
plotdest
Boolean: Set to TRUE if input point observations are to be plotted along with the SDE
plotcentroid
Boolean: Set to TRUE if the centroid is to be plotted along with the SDE
plotSDxy
Boolean: Set to TRUE if the orthogonal standard deviation box should be plotted along with the SDE
weightpoints
Boolean: Set to TRUE if the point observations are to be weighted
weights
A matrix or data frame of weights for the points
jpeg
Boolean: Set to TRUE if the plot should be saved in JPEG format

Value

  • The returned result is a list:
  • CALCCENTREBoolean: Indicates whether the mean centre was computed
  • WeightPointsBoolean: Indicates whether the points were weighted
  • UseWMCBoolean: Indicates whether the weighted mean center is to be used
  • Orig.xOriginal x-coordinate of center
  • Orig.yOriginal y-coordinate of center
  • CENTRE.xx-coordinate after computation of mean centre
  • CENTRE.yy-coordinate after computation of mean centre
  • Sigma.xHalf-length of axis along x-axis
  • Sigma.yHalf-length of axis along y-axis
  • MajorString indicating which axis is the major elliptical axis
  • MinorString indicating which axis is the minor elliptical axis
  • ThetaRotation angle in degrees
  • EccentricityA measure of eccentricity
  • Area.sdeArea of the SDE
  • TanThetaTrigonometric result
  • SinThetaTrigonometric result
  • CosThetaTrigonometric result
  • SinThetaCosThetaTrigonometric result
  • Sin2ThetaTrigonometric result
  • Cos2ThetaTrigonometric result
  • ThetaCorrCorrected theta angle for rotation of major axis from north
  • WMC.xWeighted mean center x-coordinate
  • WMC.yWeighted mean center y-coordinate

Details

This function is most powerful when used repetitively within a loop to compute the SDE for subsets of points stored in a large data table.

References

See chapter 4 of the documentation manual for CrimeStat at http://www.icpsr.umich.edu/CRIMESTAT/ and Ebdon, D. 1987. Statistics in geography. 2nd edition. New York, NY Basil Blackwell Ltd. 232 p.

See Also

calc.sdd, calc.mcp, makeshapes

Examples

Run this code
calc.sde(id = 1, filename = "SDE_Output.txt", calccentre = FALSE, useWMC = FALSE, centre.xy = centre, destmat = activities, titletxt = "Title", verbose = FALSE, plot = TRUE, calcSDxy = TRUE, plotSDEaxes = TRUE, plotdest = TRUE, plotcentroid = TRUE, plotSDxy = TRUE, weightpoints = FALSE, weights = wts, jpeg = FALSE)

Run the code above in your browser using DataCamp Workspace