anim.barplot: Create an animated barplot.

Description Usage Arguments Details Examples

View source: R/anim.plots.R

Description

Create an animated barplot.

Usage

1
2
3
4
5
6
7
8
9
anim.barplot(...)

## Default S3 method:
anim.barplot(height, times = NULL, show = TRUE,
  speed = 1, use.times = TRUE, window = t, window.process = NULL,
  width = 1, space = NULL, names.arg = NULL, beside = FALSE,
  density = NULL, angle = NULL, col = NULL, border = NULL,
  horiz = FALSE, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL,
  main = NULL, sub = NULL, offset = NULL, legend.text = NULL, ...)

Arguments

height

a vector, matrix or array. If a vector it is divided up by times and barplot is called on each chunk. If a matrix, barplot is called on each column. If an array, barplot is called on each matrix of form height[,,i].

times

a vector of times. If NULL and height is a matrix, the last dimension of height will be used

show, speed, use.times, window, window.process

see anim.plot

width, space, beside, names.arg, density, angle, col, border, horiz, xlim, ylim, xlab, ylab, main, sub, offset, legend.text, ...

arguments passed to barplot.

Details

Arguments width, names.arg, density, angle, col, border and offset may be either vectors of length length(tbl) or matrices with one column for each unique value of times. Other arguments should be length 1 or vectors.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
anim.barplot(1:100, times=rep(1:10, each=10), ylim=c(0,100))
## barplot with a matrix
ChickWeight$wq <- cut(ChickWeight$weight, 5)
tbl <- as.array(xtabs(~ wq + Diet + Time, data=ChickWeight))
ptbl <- prop.table(tbl, 2:3)
anim.barplot(ptbl, xlab="Diet", ylab="N", xlim=c(0,8), legend.text=paste(
     "Quintile", 1:5), col=1:5)
anim.barplot(tbl, xlab="Diet", ylab="N", beside=TRUE, ylim=c(0,20),
   legend.text=paste("Quintile", 1:5), col=1:5)
   

Example output

sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied

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