BoutrosLab.plotting.general (version 5.9.2)

create.gif: Make a gif

Description

Takes a function and several sets of parameters and makes a gif of their function calls

Usage

create.gif(
	exec.func,
	parameters,
	number.of.frames, 
	delay = 40, 
	filename)

Arguments

exec.func

The function that will be used to make the plots for the gif

parameters

Parameter list to be sent to the exec func at each frame

number.of.frames

Total number of frames to be made (must match number of parameter lists)

delay

Delay between each frame in the gif

filename

Name of output file (must end in .gif)

See Also

stripplot, lattice or the Lattice book for an overview of the package.

Examples

Run this code
# NOT RUN {
set.seed(223);

simple.data1 <- data.frame(
    x = sample(1:15, 10),
    y = LETTERS[1:10]
    );

simple.data2 <- data.frame(
    x = sample(1:15, 10),
    y = LETTERS[1:10]
    );

simple.data3 <- data.frame(
    x = sample(1:15, 10),
    y = LETTERS[1:10]
    );

p = list(
	list(formula = x ~ y,data = simple.data1, yat = seq(0,16,2)),
	list(formula = x ~ y,data = simple.data2, yat = seq(0,16,2)),
	list(formula = x ~ y,data = simple.data3, yat = seq(0,16,2))
	)

create.gif(
	exec.func = create.barplot, 
	parameters = p, 
	number.of.frames = 3, 
	delay = 20, 
	filename = paste0(tempdir(),'/test.gif')
	) 
# }

Run the code above in your browser using DataLab