Learn R Programming

aspace (version 4.0.1)

median_centre: Median Centre Calculator

Description

Compute the median centre from a series of point locations.

Usage

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

Value

The result is a list of terms:

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

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

Author

Randy Bui, Ron Buliung

Details

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

See Also

mean_centre, CF

Examples

Run this code
# MEDIAN CENTRE EXAMPLE
a <- median_centre(id=1, points=activities)
str(a)
print(a)

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

Run the code above in your browser using DataLab