animUnit: Generate a set of animation values.

View source: R/animate.R

animUnitR Documentation

Generate a set of animation values.

Description

These functions can be used to generate a set of values for use with grid.animate() to animate some feature of a grob.

Usage

animUnit(x, timeid = NULL, id = NULL)
animValue(x, timeid = NULL, id = NULL)
as.animUnit(x, ...)
as.animValue(x, ...)

Arguments

x

A set of animation values. Could be a numeric vector, a character vector, a unit vector, a matrix, a list of units.

timeid

A vector that associates each value of x with a time point.

id

A vector that associates each value of x with a different (numeric) identifier.

...

For future use.

Details

A set of animation values is ultimately either a numeric or character vector OR a unit vector. Subsets of the animation values can be defined per time point, or per identifier, or both.

The as functions allow animation values to be specified as matrices or lists, which are converted to formal animation value sets. The grid.animate() function calls these functions so the conversion typically happens automatically.

These functions should only have to be called directly in relatively complex cases where multiple values need to be specified per time point AND per identifier.

Value

An animUnit or animValue object.

Author(s)

Paul Murrell

See Also

grid.animate

Examples

require(grid)

animValue(c("visible", "hidden"))
animUnit(unit(1:24, "in"),
         timeid=rep(1:3, each=8),
         id=rep(1:2, 12))

gridSVG documentation built on March 31, 2023, 11:17 p.m.