merge.anim.frames: Merge anim.frames objects

Description Usage Arguments Details Examples

View source: R/postprocessing.R

Description

Merge two or more anim.frames objects to create a new anim.frames object

Usage

1
2
## S3 method for class 'anim.frames'
merge(..., speed = NULL)

Arguments

...

anim.frames objects returned from, e.g. anim.plot

speed

speed for the merged object. This may be left unspecified only if all objects have the same speed.

Details

If two or more calls in the merged animation are at the same time, calls from the earlier object in ... will be run first.

If you merge two animations from anim.plot, plot.window will be called before each frame of the merged animation. This may not be what you want. Instead, use anim.points or similar for all but the first animation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
tmp <- anim.plot(1:5, 1:5, speed=2)
tmp2 <- anim.plot(1:5, 5:1, col="red", speed=2)
## Not what you want:
replay(merge(tmp, tmp2))

## better:
tmp3 <- anim.points(1:5, 5:1,col="red", speed=2)
newf <- merge(tmp, tmp3)
replay(newf)
## NB: result of the merge looks different from the two
## individual animations

## not the same:
newf2 <- merge(tmp2, tmp) 
## points will be called before plot!
replay(newf2)

anim.plots documentation built on May 30, 2017, 12:31 a.m.