aspace (version 3.2)

calc_sde: Calculate the Standard Deviation Ellipse

Description

This function computes the Standard Deviation Ellipse (SDE) from 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 a spatial point pattern, the ellipse will be oriented in the direction of maximum dispersion.

Usage

calc_sde(id=1, filename="SDE_Output.txt", centre.xy=NULL, calccentre=TRUE, weighted=FALSE, weights=NULL, points=activities, verbose=FALSE)

Arguments

id
A unique integer to identify the shape
filename
A string indicating the ASCII textfile where shape coordinates will be written
centre.xy
A vector of length 2, containing the x- and y-coordinates of the SDE centre (Planar Coordinates Only!)
calccentre
Boolean: Set to TRUE if the mean center is to be calculated
weighted
Boolean: Set to TRUE if the weighted mean center is to be computed with weighted coordinates
weights
Weights applied to point observations, number of weights should equal the number of observations
points
A 2-column matrix or data frame containing point coordinates
verbose
Boolean: Set to TRUE if extensive feedback is desired on the standard output

Value

The returned result is a list:
id
Identifier for the SDE shape - it should be unique
calccentre
Boolean: TRUE if mean centre is computed
weighted
Boolean: TRUE if the weighted mean centre is to be used instead
CENTRE.x
X-coordinate of the centre
CENTRE.y
Y-coordinate of the centre
Sigma.x
Half-length of axis along x-axis
Sigma.y
Half-length of axis along y-axis
Major
String indicating which axis is the major elliptical axis
Minor
String indicating which axis is the minor elliptical axis
Theta
Rotation angle in degrees
Eccentricity
A measure of eccentricity (i.e., the flatness of the ellipse)
Area.sde
Area of the SDE
TanTheta
Trigonometric result
SinTheta
Trigonometric result
CosTheta
Trigonometric result
SinThetaCosTheta
Trigonometric result
Sin2Theta
Trigonometric result
Cos2Theta
Trigonometric result
ThetaCorr
Corrected theta angle for rotation of major axis from north

Details

Use the sdeloc (coordinates) and sdeatt(attributes) to produce shapefiles using the convert.to.shapefile and write.shapefile from the shapefiles library

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

plot_sde, calc_sdd, calc_box,gridpts

Examples

Run this code
## SDE example
calc_sde(id=1, filename="SDE_Output.txt", centre.xy=NULL, calccentre=TRUE, 
weighted=FALSE, weights=NULL, points=activities, verbose=FALSE)

## plot_sde by default takes as input the result produced from the calc_sde, read from the current workspace. 

## SDE to shapefile example (exclude the comments below to run script)
## shp <- convert.to.shapefile(sdeloc,sdeatt,"id",5)
## write.shapefile(shp, "SDE_Shape", arcgis=T)

Run the code above in your browser using DataCamp Workspace