Learn R Programming

aspace (version 3.2)

CMD: Centre of Minimum Distance (CMD) Calculator

Description

Compute the CMD within a set of point locations.

Usage

CMD(id=1, filename="CMD_Output.txt", dist=100, points=activities)

Arguments

id
A unique integer to identify the CMD
filename
A string indicating the ASCII textfile where centre coordinates will be written
dist
Hold distance value between i and ith iterations
points
A 2-column matrix or data frame containing the set of point observations

Value

The result is a list of terms:
id
Identifier for the CMD - it should be unique
CMD.x
X-coordinate of the CMD
CMD.y
Y-coordinate of the CMD
distance
Hold distance value between i and ith iterations (metres
Number of Cells
Hold number of cells in each grid created for each iteration

Details

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

See Also

mean_centre, median_centre, CF

Examples

Run this code
## CMD example
CMD(id=1, filename="CMD_Output.txt", dist=100, 
points=activities)

## CMD to shapefile example (exclude the comments below to run script)
## shp <- convert.to.shapefile(cmdloc,cmdatt,"id",5)
## write.shapefile(shp, "CMD_Shape", arcgis=T)

Run the code above in your browser using DataLab