replay: Replay an 'anim.frames' object

Description Usage Arguments Details Examples

View source: R/postprocessing.R

Description

Replay all or some of the frames of an object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
replay(...)

## S3 method for class 'anim.frames'
replay(
  x,
  frames = 1:length(x),
  speed = attr(x, "speed"),
  after = NULL,
  before = NULL,
  ...
)

## S3 method for class 'anim.frames'
plot(x, ...)

Arguments

...

other arguments (not currently used)

x

an anim.frames object

frames

numeric vector specifying which frames to replay

speed

a new speed

after

an expression to evaluate after each frame is plotted

before

an expression to evaluate before each frame is plotted

Details

before and after will have the arguments from the frame's call available in their environment - see the example.

The plot method simply calls replay.

Examples

1
2
3
4
5
6
7
8
myplot <- anim.plot(1:10, 1:10, speed=3)
replay(myplot, speed=5)
replay(myplot, frames=c(1,5,6,10))

myplot <- anim.plot(x<-rnorm(100), x+rnorm(100,0,3), 20, window=1:t, 
     show=FALSE, main="Regressions as sample size increases")
replay(myplot, after=abline(lm(y~x), col="red"))
 

hughjonesd/anim.plots documentation built on May 5, 2021, 3:07 p.m.