Learn R Programming

spathial (version 0.1.2)

spathialBoundaryIds: Select starting and ending points

Description

Get the coordinates of the starting and ending points

Usage

spathialBoundaryIds(X, X_labels = NULL, mode = 1, from = NULL, to = NULL)

Arguments

X

data points

X_labels

labels of the data points

mode

strategy for boundary selection

  • 1 - selected by the user

  • 2 - centroids

  • 3 - insert the row name of the starting and ending points

from

starting class or row name of the starting point

to

ending class or row name of the ending point

Value

A list of objects

  • boundary ids: the indexes of the boundaries

  • X: the new data matrix with the boundary

  • X_labels: the new labels of the data matrix with the boundary labels

Examples

Run this code
# NOT RUN {
# Load data matrix X
load(system.file('extdata','X.rda',package='spathial',mustWork=TRUE))
# Load description vector X_labels
load(system.file('extdata','X_labels.rda',package='spathial',mustWork=TRUE))
# Run spathialBoundary
boundaryRes <- spathialBoundaryIds(X, X_labels, mode=2, from=3, to=6)
# }

Run the code above in your browser using DataLab