Learn R Programming

aspace (version 2.5)

calc_box: Calculate the Standard Deviation Box

Description

The orthogonal dispersion of a set of points can be described using the standard deviation of the x- and y-coordinates of a set of point observations. The orthogonal dispersion can then be visualized with a Standard Deviation Box. This function computes the properties of the Standard Deviation Box (SD Box) from a set of point observations.

Usage

calc_box(id=1, filename="BOX_Output.txt", centre.xy=NULL, calccentre=TRUE, 
weighted=FALSE, weights=NULL, CMD.npts=10000, points=activities, verbose=FALSE)

Arguments

id
A unique integer to identify a SD Box
filename
A string indicating the ASCII textfile where the box coordinates will be written
centre.xy
A vector of length 2, containing the x- and y-coordinates of the geographic centre of the SD Box
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
CMD.npts
The approximate number of points to generate for the centre of minimum distance (CMD) calculation
points
A 2-column matrix or data frame containing the set of point observations input to the calc_box function
verbose
Boolean: Set to TRUE if extensive feedback is desired on the standard output

Value

  • The returned result is a list:
  • idIdentifier for the SD Box shape - it should be unique
  • calccentreBoolean: TRUE if the mean centre was estimated
  • weightedBoolean: TRUE if the weighted mean centre was estimated
  • CENTRE.xX-coordinate of the centre
  • CENTRE.yY-coordinate of the centre
  • central.xX-coordinate of the identified central feature
  • central.yY-coordinate of the identified central feature
  • median.xX-coordinate of median centre, median value of the X-coordinate vector
  • median.yY-coordinate of median centre, median value of the Y-coordinate vector
  • CMD.xX-coordinate of estimated centre of minimum distance
  • CMD.yY-coordinate of estimated centre of minimum distance
  • SD.xOrthogonal standard deviation in the x-axis
  • SD.yOrthogonal standard deviation in the y-axis
  • Box.areaArea of the standard deviation box
  • NW.coordNorth-west coordinates of SD Box
  • NE.coordNorth-east coordinates of SD Box
  • SW.coordSouth-west coordinates of SD Box
  • SE.coordSouth-east coordinates of SD Box

Details

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

See Also

plot_box, calc_mcp, calc_sde, calc_sdd, ellipse3, makeshapes, mcp, gridpts, wtd.var

Examples

Run this code
calc_box(id=1, filename="BOX_Output.txt", centre.xy=NULL, calccentre=TRUE, 
weighted=FALSE, weights=NULL, CMD.npts=10000, points=activities, verbose=TRUE)

Run the code above in your browser using DataLab