Learn R Programming

aspace (version 4.0.1)

mean_centre: Mean Centre Calculator

Description

Compute the mean centre from a series of point locations.

Usage

mean_centre(id=1, weighted=FALSE, weights=NULL,
 points=NULL, verbose=FALSE)

Value

The result is a list of terms:

id

Identifier for the mean centre - it should be unique

weighted

Boolean: TRUE if the weighted mean centre is to be used instead

weights

Weights applied to point observations

CENTRE.x

X-coordinate of the mean centre

CENTRE.y

Y-coordinate of the mean centre

Arguments

id

A unique integer to identify the mean centre

weighted

Boolean: Set to TRUE if the weighted mean center is to be computed with weighted coordinates

weights

Weights applied to point observations, number of weights should equal the number of observations

points

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

verbose

A Boolean flag that controls verbose feedback to the monitor

Author

Randy Bui, Ron Buliung

Details

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

See Also

median_centre, CF

Examples

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

# MEAN CENTRE TO SHAPEFILE EXAMPLE (REMOVE THE COMMENTS TO RUN)
# shp <- convert.to.shapefile(meanloc,meanatt,"id",5)
# write.shapefile(shp, "Mean_Shape", arcgis=T)

Run the code above in your browser using DataLab