calc_mdc: Median Centre Calculator

calc_mdcR Documentation

Median Centre Calculator

Description

Compute the median centre from a series of point locations.

Usage

calc_mdc(id=1, points=NULL, verbose=FALSE)

Arguments

id

A unique integer to identify the median centre

points

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

verbose

A Boolean flag to control verbose content on the monitor

Details

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

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

LOCATIONS

Locations pertinent for the MDC 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.

ATTRIBUTES

Attributes for the output MDC 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 median centre - it should be unique

median.x

X-coordinate of the median centre

median.y

Y-coordinate of the median centre

Note

Results are stored in the r.median object and can be passed through plotting functions. This function can also be used repetitively within a loop to compute multiple median centres from different datasets.

Author(s)

Randy Bui, Ron Buliung

See Also

calc_box, calc_sdd, calc_sde, calc_cmd, calc_cf, calc_cf2pts, calc_mnc

Examples

# MEDIAN CENTRE EXAMPLE
a <- calc_mdc(id=1, points=activities)
str(a)
print(a)

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

aspace documentation built on May 29, 2024, 2:04 a.m.

Related to calc_mdc in aspace...