Usage
## S3 method for class 'default':
sieveplot(x, reverse_y = TRUE, type = c("observed", "expected"),
main = deparse(substitute(x)),
values = c("none", "cells", "margins", "both"),
frequencies = c("absolute", "relative"),
sieve_colors = c("red","blue"),
sieve_lty = c("longdash", "solid"), exp_color = "gray",
exp_lty = "dotted", margin = 0.01, newpage = TRUE, pop = TRUE,
margins = c(4,3,4,4), xlab = names(dimnames(x))[2],
ylab = names(dimnames(x))[1], ...)
## S3 method for class 'formula':
sieveplot(formula, data = NULL, \dots, subset)
Arguments
x
a two-way contingency table, as generated by
table
. reverse_y
logical; if TRUE
, the y axis is reversed
(i.e., the rectangles' positions correspond to the contingency
table).
type
switch indicating whether rectangles should be filled
according to observed
or expected
frequencies.
main
character string specifying the title.
values
switch indicating whether the frequencies of
cells
or margins
or of both
should be plotted.
frequencies
switch indicating the type of these frequencies:
relative
or absolute
.
sieve_colors, sieve_lty
vectors with up to two color/line type
entries: the first is used for negative and the second for positive
deviations from the expected frequencies.
exp_color, exp_lty
color/line type entry for the expected
values grid.
margin
lines of margin between the cell rectangles.
margins
vector of margins (see par
). newpage
logical; if TRUE
, the plot is drawn on a new page.
pop
logical; if TRUE
, all newly generated viewports are popped after plotting.
xlab, ylab
labels of x- and y-axis.
formula
a formula, such as y ~ x
.
For details, see xtabs
. data
a data frame (or list), or a contingency table from which
the variables in formula
should be taken.
subset
an optional vector specifying a subset of the rows in
the data frame to be used for plotting.
...
further graphics parameters (see gpar
).