Learn R Programming

dtwSat (version 0.2.8)

plotPaths: Plotting paths

Description

Method for plotting low cost paths in the TWDTW cost matrix.

Usage

plotPaths(x, timeseries.labels = NULL, patterns.labels = NULL, k = NULL)

Value

A ggplot object.

Arguments

x

An object of class twdtwMatches.

timeseries.labels

The label or index of the time series. Default is 1.

patterns.labels

A vector with labels of the patterns. If not declared the function will plot one alignment for each pattern.

k

A positive integer. The index of the last alignment to include in the plot. If not declared the function will plot all low cost paths.

Author

Victor Maus, vwmaus1@gmail.com

References

Maus:2019dtwSat

Maus:2016dtwSat

See Also

twdtwMatches-class, twdtwApply, plotAlignments, plotCostMatrix, plotMatches, and plotClassification.

Examples

Run this code
log_fun = logisticWeight(-0.1, 100)
ts = twdtwTimeSeries(MOD13Q1.ts.list)
patt = twdtwTimeSeries(MOD13Q1.patterns.list)
mat1 = twdtwApply(x=ts, y=patt, weight.fun=log_fun, keep=TRUE, legacy=TRUE)

plotPaths(mat1)

plotPaths(mat1, patterns.labels="Soybean", k=1:2)

plotPaths(mat1, patterns.labels=c("Maize","Cotton"), k=2)

Run the code above in your browser using DataLab