plot.table {graphics}R Documentation

Plot Methods for 'table' Objects


This is a method of the generic plot function for (contingency) table objects. Whereas for two- and more dimensional tables, a mosaicplot is drawn, one-dimensional ones are plotted “bar like”.


## S3 method for class 'table':
plot(x, type = "h", ylim = c(0, max(x)), lwd = 2,
     xlab = NULL, ylab = NULL, frame.plot = is.num, ...)


x a table (like) object.
type plotting type.
ylim range of y-axis.
lwd line width for bars when type = "h" is used in the 1D case.
xlab, ylab x- and y-axis labels.
frame.plot logical indicating if a frame (box) should be drawn in the 1D case. Defaults to true when x has dimnames coerce-able to numbers.
... further graphical arguments, see plot.default.


The current implementation (R 1.2) is somewhat experimental and will be improved and extended.

See Also

plot.factor, the plot method for factors.


## 1-d tables
( <- table(N = rpois(200, lam= 5)))
plot(, main = "plot(table(rpois(200, lam=5)))")


## 4-D :
plot(Titanic, main ="plot(Titanic, main= *)")

[Package graphics version 2.5.0 Index]