Learn R Programming

dtwSat (version 0.2.8)

plotClassification: Plotting subintervals classification

Description

Method for plotting the classification of each subinterval of the time series based on TWDTW analysis.

Usage

plotClassification(
  x,
  timeseries.labels = NULL,
  patterns.labels = NULL,
  attr,
  ...
)

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.

attr

An integer vector or character vector indicating the attribute for plotting. If not declared the function will plot all attributes.

...

Additional arguments passed to twdtwClassify.

Author

Victor Maus, vwmaus1@gmail.com

References

Maus:2019dtwSat

Maus:2016dtwSat

See Also

twdtwMatches-class, twdtwApply, twdtwClassify, plotAlignments, plotPaths, plotMatches, and plotCostMatrix.

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)

# Classify interval
from = as.Date("2007-09-01")
to = as.Date("2013-09-01")
by = "6 month"
gp = plotClassification(x=mat1, from=from, to=to, by=by, overlap=.5)
gp


Run the code above in your browser using DataLab