animUnit: Generate a set of animation values.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/animate.R

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

1
2
3
4
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

1
2
3
4
5
6
require(grid)

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

Example output

Attaching package: 'gridSVG'

The following object is masked from 'package:grDevices':

    dev.off

Loading required package: grid
$t1
[1] "visible"

$t2
[1] "hidden"

$id1
$id1$t1
[1] 1in 3in 5in 7in

$id1$t2
[1] 9in  11in 13in 15in

$id1$t3
[1] 17in 19in 21in 23in


$id2
$id2$t1
[1] 2in 4in 6in 8in

$id2$t2
[1] 10in 12in 14in 16in

$id2$t3
[1] 18in 20in 22in 24in

gridSVG documentation built on Oct. 4, 2017, 3:01 a.m.

Related to animUnit in gridSVG...