create.gif | R Documentation |
Takes a function and several sets of parameters and makes a gif of their function calls
create.gif(
exec.func,
parameters,
number.of.frames,
delay = 40,
filename)
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) |
Jeffrey Green
stripplot
, lattice
or the Lattice book for an overview of the package.
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 = tempfile(pattern = 'test', fileext = '.gif')
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.