Learn R Programming

aspace (version 2.5)

mean_centre: Mean Centre Calculator

Description

Compute the mean centre from a series of point locations.

Usage

mean_centre(id=1, filename="mean_centre_Output.txt", 
weighted=FALSE, weights=NULL, points=activities)

Arguments

id
A unique integer to identify the mean centre
filename
A string indicating the ASCII textfile where centre coordinates will be written
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

Value

  • The result is a list of terms:
  • idIdentifier for the mean centre - it should be unique
  • weightedBoolean: TRUE if the weighted mean centre is to be used instead
  • weightsWeights applied to point observations
  • CENTRE.xX-coordinate of the mean centre
  • CENTRE.yY-coordinate of the mean centre

Details

This function is most powerful when used repetitively within a loop to compute multiple mean centres from different datasets.

See Also

median_centre, CMD, CF

Examples

Run this code
mean_centre(id=1, filename="mean_centre_Output.txt", 
weighted=FALSE, weights=NULL, points=activities)

Run the code above in your browser using DataLab