fd {snippets}R Documentation

Fluctuation diagram

Description

Draws a fluctuation diagram.

Usage

fd(x, ...)
## S3 method for class 'matrix'
fd(x, add = FALSE, vals = FALSE, at.x, at.y, axes = TRUE,
frame.plot = FALSE, main = NULL, sub = NULL, xlab = NULL, ylab = NULL,
zmax = max(x, na.rm = TRUE), xlim, ylim, asp = 1, panel.first = NULL,
panel.last = NULL, ann = par("ann"), col = "grey", border = "black",
...)

Arguments

x

object to draw fluctuation diagram of (most commonly a table)

add

a logical value indicating whether to add to an existing plot (TRUE) or to create a new plot (FALSE).

vals

a logical value indicating whether to draw values into the rectangles (discouraged and unimplemented).

at.x

locations of the colums (by default 1:ncol)

at.y

locations of the rows (by default 1:nrow)

axes

a logical value indicating whether both axes should be drawn on the plot. Use graphical parameter xaxt or yaxt to suppress just one of the axes.

frame.plot

a logical indicating whether a box should be drawn around the plot.

main

a main title for the plot, see also title.

sub

a subtitle for the plot.

xlab

a label for the x axis.

ylab

a label for the y axis.

zmax

value representing the total size of an allocated box.

xlim

the x limits (x1, x2) of the plot. The default is the range of at.x with an additional 0.5 margin of the ends.

ylim

the y limits of the plot.

asp

the y/x aspect ratio, see plot.window.

panel.first

an expression to be evaluated after the plot axes are set up but before any plotting takes place. This can be useful for drawing background grids

panel.last

an expression to be evaluated after plotting has taken place.

ann

see "ann" graphical parameter

col

color of the boxes to be filled with, will be recycled to match the shape of x.

border

color of the box borders - only scalar value is supported at the moment.

...

additional graphical parameters

Value

Returns (invisibly) a data frame describing the sparse representation of the boxes as location and radius.

Examples

## this is best viewed on a wide-screen device...
par(mfrow=c(1,2))
for (sex in dimnames(HairEyeColor)$Sex)
  fd(HairEyeColor[,,sex], main=sex)

[Package snippets version 0.1-1 Index]