CMD: Centre of Minimum Distance (CMD) Calculator

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Compute the CMD within a set of point locations.

Usage

1
2
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

Details

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

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

Note

Results are stored in the r.CMD object and can be passed through plotting functions. The dist parameter specifies the distance threshold between i and ith iterations. This function can also be used repetitively within a loop to compute multiple CMD centres from different datasets.

Author(s)

Randy Bui, Ron Buliung

See Also

mean_centre, median_centre, CF

Examples

1
2
3
4
5
6
7
## 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)

Example output

Loading required package: splancs
Loading required package: sp

Spatial Point Pattern Analysis Code in S-Plus
 
 Version 2 - Spatial and Space-Time analysis

Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following object is masked from 'package:splancs':

    zoom

The following objects are masked from 'package:base':

    format.pval, units

Loading required package: shapefiles
Loading required package: foreign

Attaching package: 'shapefiles'

The following objects are masked from 'package:foreign':

    read.dbf, write.dbf

  id    CMD.x   CMD.y Distance Number.of.Cells
1  1 609382.3 4828227    97.71              35

aspace documentation built on May 2, 2019, 6:24 a.m.

Related to CMD in aspace...