ca_animate: Create animated gif or video from simulation result.

Description Usage Arguments Details Value See Also Examples

View source: R/animate.R

Description

Create animated gif or video from simulation result.

Usage

1
ca_animate(x, filename, type = "gif", speed = 1, directory = getwd(), ...)

Arguments

x

A ca_result object (generated by ca())

filename

A character value specifying relative path and filename. File endings will be ignored and replaced by value in type.

type

A character value specifying the type of output. Either "gif" (tiny animated gif), "mp4", "wmv", or "avi".

speed

A numeric value specifying the relative speed of the output (defaults to 1).

directory

A character string specifying the absolute or relative target path. Defaults to current working directory.

...

further parameters will be handed to the function saveGIF or saveVIDEO.

Details

This requires R-package [animation] and the additional software ImageMagick (for animated .gif) and FFMPEG (for .mpeg videos).

Value

Returns an animated gif or video.

See Also

animate.ca_model

Examples

1
2
3
4
5
# 1. run simulation and save full landsape at each timestep. create animated gif.

l <- init_landscape(c("1","0"), c(0.6,0.4), 100)
r <- ca(l, model = life, t_max = 500)
ca_animate(r, "life01.gif")

caspr documentation built on May 2, 2019, 5:25 p.m.