Learn R Programming

aspace (version 3.2)

CF2PTS: Central feature between 2 point patterns (CF2PTS) Calculator

Description

Central feature of point2 within point1. Identifies the central feature as the point location in the first pattern that has the smallest cummulative distance to features in a second point pattern.

Usage

CF2PTS(id=1, filename="CF2PTS_Output.txt", points1=activities, points2=activities2)

Arguments

id
A unique integer to identify the CF2PTS
filename
A string indicating the ASCII textfile where the central feature coordinates will be written
points1
A 2-column matrix or data frame containing the set of point observations
points2
A 2-column matrix or data frame containing the set of point observations

Value

The result is a list of terms:
id
Identifier for the central feature - it should be unique
CF2PTS.x
X-coordinate of the central feature
CF2PTS.y
Y-coordinate of the central feature

Details

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

See Also

CF, CMD, median_centre

Examples

Run this code
## CF2PTS example
CF2PTS(id=1, filename="CF2PTS_Output.txt", points1=activities, points2=activities2)

## CF2PTS to shapefile example (exclude the comments below to run script)
## shp <- convert.to.shapefile(cf2ptsloc,cf2ptsatt,"id",5)
## write.shapefile(shp, "CF2PTS_Shape", arcgis=T)

Run the code above in your browser using DataLab