Skip to contents

Generates an animation of a data stream.

Usage

animate_data(dsd, horizon = 100, n = 1000, wait = 0.1, plot.args = NULL, ...)

Arguments

dsd

a DSD object

horizon

the number of points displayed at once/used for evaluation.

n

the number of points to be plotted

wait

the time interval between each frame

plot.args

a list with plotting parameters for the clusters.

...

extra arguments are added to plot.args.

Details

Animations are recorded using the library animation and can be replayed (which gives a smoother experience since the is no more computation done) and saved in various formats (see Examples section below).

Note: You need to install package animation and its system requirements.

Author

Michael Hahsler

Examples

if (interactive()) {

stream <- DSD_Benchmark(1)
animate_data(stream, horizon = 100, n = 5000, xlim = c(0,1), ylim = c(0,1))

### animations can be replayed with the animation package
library(animation)
animation::ani.options(interval = .1) ## change speed
ani.replay()

### animations can also be saved as HTML, animated gifs, etc.
saveHTML(ani.replay())
}