calc_box | R Documentation |
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.
calc_box(id=1, centre.xy=NULL, calccentre=TRUE, weighted=FALSE,
weights=NULL, points=NULL, verbose=FALSE)
id |
A unique integer to identify a SD Box |
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 |
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 |
Use the LOCATIONS element in the output list object along with the ATTRIBUTES elements can be used to produce shapefiles or other vector point files for geographic data.
The returned result is a list:
TYPE |
The type of calculation results stored in the object: BOX, SDD, SDE, CMD, CF, or CF2PTS, MNC, MDC |
DATE |
The date and time that the function was run |
ID |
Identifier for the SD Box shape - it should be unique |
LOCATIONS |
Locations pertinent for the BOX that can be used with ATTRIBUTES if wishing to build a vector point file for geographic data outside of this pacakge. |
FORPLOTTING |
Coordinates and identifiers used for plotting by plot_box() |
ATTRIBUTES |
Attributes for the output BOX that can be used with LOCATIONS coordinates if wishing to build a vector point file for geographic data outside of this package. |
id |
Identifier for the SD Box shape - it should be unique |
calccentre |
Boolean: TRUE if the mean centre was estimated |
weighted |
Boolean: TRUE if the weighted mean centre was estimated |
CENTRE.x |
X-coordinate of the centre |
CENTRE.y |
Y-coordinate of the centre |
SD.x |
Orthogonal standard deviation in the x-axis |
SD.y |
Orthogonal standard deviation in the y-axis |
Box.area |
Area of the standard deviation box |
NW.coord |
North-west coordinates of SD Box |
NE.coord |
North-east coordinates of SD Box |
SW.coord |
South-west coordinates of SD Box |
SE.coord |
South-east coordinates of SD Box |
Results specific for plotting are stored in the FORPLOTTING element within the produced list object. Pass the entire object to plot_box() and the function automatically extracts this information. This function can be used on its own (once) or repetitively in a loop to process grouped point data stored in a larger table. When used repetitively, be sure to increment the id argument to ensure that each SD BOX has a unique identifier.
Tarmo K. Remmel, Randy Bui, Ron N. Buliung
calc_sdd
,
calc_sde
,
calc_cmd
,
calc_cf
,
calc_cf2pts
,
calc_mnc
,
calc_mdc
,
wtd.var
# BOX EXAMPLE
data(activities)
a <- calc_box(id=1, centre.xy=NULL, points=activities)
str(a)
print(a)
# IF THE RESULT OF THIS FUNCTION IS STORED TO AN OBJECT, THE plot_box()
# FUNCTION WILL TAKE THAT OBJECT AS INPUT FOR PLOTTING VIA THE datin ARGUMENT
# BOX TO SHAPEFILE EXAMPLE (REMOVE THE COMMENTS TO RUN)
# shp <- convert.to.shapefile(a$LOCATIONS, a$ATTRIBUTES, "id", 5)
# write.shapefile(shp, "BOX_Shape", arcgis=T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.