calc_mnc: Mean Centre Calculator

calc_mncR Documentation

Mean Centre Calculator

Description

Compute the mean centre from a series of point locations.

Usage

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

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

Details

Use the meanloc (coordinates) and meanatt(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 mean centre - it should be unique

LOCATIONS

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

Note

Results are stored in the r.mean object and can be passed through plotting functions. This function can also be used repetitively within a loop to compute multiple mean 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_mdc

Examples

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

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

aspace documentation built on Sept. 8, 2023, 5:48 p.m.

Related to calc_mnc in aspace...