Func.visual.MultiMotif: A function to prepare the data for the visualization of...

Description Usage Arguments Value Examples

View source: R/TSMining.R

Description

This function prepares the data used for visualizing multivariate motifs.

Usage

1
Func.visual.MultiMotif(data, multi.motifs, index)

Arguments

data

is a data frame containing the multivariate time series data. Each column represents a time series.

multi.motifs

is the result of Func.motif.multivariate

index

is an integer which specifies the No. of multivariate motif to be plotted

Value

The function returns a data frame for the ease of visualizing multivariate motif discovered

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(test)
#Perform univariate motif discovery
res.1 <- Func.motif(ts = test$TS1, global.norm = TRUE, local.norm = FALSE,
window.size = 10, overlap = 0, w = 5, a = 3, mask.size = 3, eps = .01)
res.2 <- Func.motif(ts = test$TS2, global.norm = TRUE, local.norm = FALSE,
window.size = 20, overlap = 0, w = 5, a = 3, mask.size = 3, eps = .01)
res.multi <- Func.motif.multivariate(motif.list = list(res.1$Indices, res.2$Indices),
window.sizes = c(10,20), alpha = .8)
#Use the function to prepare the data frame for visualizing the first multivariate motifs identified
data.multi <- Func.visual.MultiMotif(data = test, multi.motifs = res.multi, index = 1)
#Make the plot using ggplot2
library(ggplot2)
ggplot(data = data.multi) +
 geom_line(aes(x = T, y = X)) +
 geom_point(aes(x = T, y = X, col=Lab, shape=Lab)) + facet_grid(Facet~.)

Example output

================================================================================Joining by: Index.adj

TSMining documentation built on May 2, 2019, 3:54 p.m.