plot.table

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 as bars.

Keywords
hplot, category
Usage
"plot"(x, type = "h", ylim = c(0, max(x)), lwd = 2, xlab = NULL, ylab = NULL, frame.plot = is.num, ...) "points"(x, y = NULL, type = "h", lwd = 2, ...) "lines"(x, y = NULL, type = "h", lwd = 2, ...)
Arguments
x
a table (like) object.
y
Must be NULL: there to protect against incorrect calls.
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. axes = FALSE is accepted.
See Also

plot.factor, the plot method for factors.

Aliases
  • plot.table
  • lines.table
  • points.table
Examples
library(graphics) ## 1-d tables (Poiss.tab <- table(N = stats::rpois(200, lambda = 5))) plot(Poiss.tab, main = "plot(table(rpois(200, lambda = 5)))") plot(table(state.division)) ## 4-D : plot(Titanic, main ="plot(Titanic, main= *)")
Documentation reproduced from package graphics, version 3.0.3, License: Part of R 3.0.3

Community examples

Looks like there are no examples yet.