spathialPrefiltering {spathial} | R Documentation |
Prefilter data
Description
Regularized K-means for principal path: prefiltering
Usage
spathialPrefiltering(X, boundary_ids)
Arguments
X |
data points |
boundary_ids |
names of the start and ending points, to be treated separately |
Value
A list of objects
mask: indexes of the data points to preserv
boundary_ids: the filtered boundary ids
Examples
# 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
# Run spathial spathialPrefilterinh with the output of the function spathialBoundaryIds
filterRes <- spathialPrefiltering(X, boundary_ids)
# Extract prefiltering results
mask <- filterRes$mask
boundary_ids <- filterRes$boundary_ids
X <- X[mask,]
[Package spathial version 0.1.2 Index]