movie: Visualizes the 'dpseg' segmentation recursion as a movie.

Description Usage Arguments Examples

View source: R/dpseg.R

Description

Generates a movie of the calculation steps j=1,…,n while looping through the recursion S_j. Plots are sent to the active plot device or, if path is specified, to a video file <path>/<file.name>.<format> via a system call to Image Magick's convert. Saving to a file likely only works on Linux systems with Image Magick installed and convert available in the $PATH environment variable. format are formats available for convert, eg. format="gif" or format="mpeg". See the vignette("dpseg") for details on the plotted data.

Usage

1
2
3
movie(dpseg, fix.ylim = TRUE, frames, delay = 0.1, repeat.last = 5,
  ylab = "scoring function", ylab2 = "y", xlab = "x", path,
  file.name = "dpseg_movie", format = "gif", res = 200, ...)

Arguments

dpseg

result object of class dpseg returned by function dpseg

fix.ylim

fix the y-axis of the score function

frames

x range to show as movie frames

delay

delay between frames in seconds, between x11 plot updates or as argument -delay to the system call to Image Magick's convert

repeat.last

repeat list frame this many times

ylab

left y-axis label, for the scoring funtion

ylab2

right y-axis label, for the original data

xlab

x-axis label

path

path where both temporary jpeg files and the final movie file will be generated. If not specified the indidividual frames will be plotted to the active plot device.

file.name

name of the generated video file <path>/<file.name>.<format>

format

format of the video, all outputs that image magick's convert can generate, e.g. "mpg" or "gif"

res

resolution of the generated movie (pixels per inch)

...

arguments passed to default plot function

Examples

1
2
3
4
5
6
7
8
9
## NOTE: requires that dpseg is run with store.matrix=TRUE
segs <- dpseg(x=oddata$Time, y=log(oddata$A3), minl=5, P=0.0001, store.matrix=TRUE)

## View the algorithm in action:
movie(segs, delay=0)

## NOTE: if Image Magick's convert is installed you can set the path
## option to save the movie as <path>/<file.name>.<format>, where format
## can be "gif", "mpeg" or else, depending on the Image Magick installation.

dpseg documentation built on Aug. 17, 2020, 5:06 p.m.