spathialLabels: Find labels

Description Usage Arguments Value Examples

View source: R/runFunctions.R

Description

Get the label of each waypoint according to the neighbourhood

Usage

1
spathialLabels(X, X_labels, spathial_res)

Arguments

X

data points

X_labels

labels of the data points

spathial_res

principal path from the starting point to the ending point

Value

ppath_labels: labels of the waypoints

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#EXAMPLE 1
# 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)
X <- boundaryRes$X
X_labels <- boundaryRes$X_labels
boundary_ids <- boundaryRes$boundary_ids
#Set the number of waypoints
NC <- 20
# Run spathialWay
spathial_res <- spathialWay(X, boundary_ids, NC)
#Run spathialLabels with spathial_res
labels <- spathialLabels(X, X_labels, spathial_res)
labels

spathial documentation built on April 14, 2020, 6:41 p.m.