Learn R Programming

hypervolume (version 2.0.12)

hypervolume_save_animated_gif: Saves animated GIF of three-dimensional hypervolume plot.

Description

Assumes there is an open RGL plot (e.g. from calling plot(hv, show.3d=TRUE)). Rotates the plot around an axis at a given speed and saves results as a series of GIFs. If the magick package is available, combines these GIFs into a single animation.

Usage

hypervolume_save_animated_gif(image.size = 400, 
                              axis = c(0, 0, 1), rpm = 4, duration = 15, fps = 10, 
                              file.name = "movie", directory.output = ".", ...)

Arguments

image.size

Number of pixels on each side of the animated image.

axis

A three-element vector describing the rotation axis.

rpm

Animation speed in rotations per minute.

duration

Animation duration in seconds.

fps

Animation speed in frames per second.

file.name

A base name (no extension) for the GIFs.

directory.output

The folder in which output should be located.

Other arguments to be passed to rgl::movie3d.

Value

None; used for the side-effect of producing files.

Examples

Run this code
# NOT RUN {
# not run for speed - uncomment to try!
#data(iris)
# hv = hypervolume_gaussian(iris[,1:3])
# plot(hv, show.3d=TRUE)
# hypervolume_save_animated_gif()

# }

Run the code above in your browser using DataLab