calc_mdc | R Documentation |
Compute the median centre from a series of point locations.
calc_mdc(id=1, points=NULL, verbose=FALSE)
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 |
Use the medianloc (coordinates) and medianatt(attributes) to produce shapefiles using the convert.to.shapefile and write.shapefile from the shapefiles library
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 |
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.
Randy Bui, Ron Buliung
calc_box
,
calc_sdd
,
calc_sde
,
calc_cmd
,
calc_cf
,
calc_cf2pts
,
calc_mnc
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.