Learn R Programming

aspace (version 4.1.1)

calc_cmd: Centre of Minimum Distance (CMD) Calculator

Description

Compute the CMD within a set of point locations.

Usage

calc_cmd(id=1, dist=100, points=NULL, verbose=FALSE)

Value

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 CMD - it should be unique

LOCATIONS

Locations pertinent for the CMD 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_cmd()

ATTRIBUTES

Attributes for the output CMD 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 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

Arguments

id

A unique integer to identify the CMD

dist

Hold distance value between i and ith iterations

points

A 2-column matrix or data frame containing the set of point observations

verbose

A Boolean flag to control verbose feedback on screen

Author

Randy Bui, Ron Buliung, Tarmo K. Remmel

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

calc_box, calc_sdd, calc_sde, calc_cf, calc_cf2pts, calc_mnc, calc_mdc

Examples

Run this code
# CMD EXAMPLE
a <- calc_cmd(id=1, dist=100, points=activities)
str(a)
print(a)

# CMD TO SHAPEFILE EXAMPLE (REMOVE THE COMMENTS TO RUN)
# shp <- convert.to.shapefile(a$LOCATIONS, a$ATTRIBUTES, "id", 5)
# write.shapefile(shp, "CMD_Shape", arcgis=T)

Run the code above in your browser using DataLab