Learn R Programming

TED (version 1.1.1)

aniplotevents: Generate a gif to visualise the event detection process

Description

This function generates a gif file demonstrating how the event detection process is implemented.

Usage

aniplotevents(x, w, noiseType = c("white", "red"), alpha = 0.05, main = "Animation plot of events", xlab = "t", ylab = "x", movie.name = "animation.gif", interval = 0.05, ani.width = 1000, ani.height = 400, outdir = getwd())

Arguments

x
a vector or a time series.
w
a scalar specifying the size of the sliding window.
noiseType
background noise type assumed for x. There are two options: white noise or red noise.
alpha
the significance level. When the noise test p value of the subsequence is smaller than this significance level, it is defined as a potential event.
main
title of the animiation plot; default is `Animation plot of event detection'.
xlab
x label of the animation plot; default is `t'.
ylab
y label of the animation plot; default is `x'.
movie.name
name of the output gif file; default is `animation.gif'.
interval
a positive number to set the time interval of the animation (unit in seconds); default is 0.05.
ani.width
width of the gif file (unit in px), default is 1000.
ani.height
height of the gif file (unit in px); default is 400.
outdir
character: specify the output directory when exporting the animations; default to be the current working directory.

Value

...

References

Yihui Xie (2013). Animation: An R Package for Creating Animations and Demonstrating Statistical Methods. Journal of Statistical Software, 53(1), 1-27. http://www.jstatsoft.org/v53/ i01/.

See Also

noiseTests, eventExtraction, plotevents

Examples

Run this code
set.seed(123)
# generate an artificial time series
x=c(rnorm(128),cbfs(type='box'),rnorm(128),cbfs(type='rc'),rnorm(128))
# generate a gif file to show the event detection process
## Not run: 
# aniplotevents(x,w=128,noiseType='white',outdir=getwd())
# ## End(Not run)

Run the code above in your browser using DataLab