plot.table
Plot Methods for table Objects
Description
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.
Usage
## S3 method for class 'table' plot(x, type = "h", ylim = c(0, max(x)), lwd = 2, xlab = NULL, ylab = NULL, frame.plot = is.num, ...) ## S3 method for class 'table' points(x, y = NULL, type = "h", lwd = 2, ...) ## S3 method for class 'table' lines(x, y = NULL, type = "h", lwd = 2, ...)
Arguments
x | a |
y | Must be |
type | plotting type. |
ylim | range of y-axis. |
lwd | line width for bars when |
xlab, ylab | x- and y-axis labels. |
frame.plot | logical indicating if a frame ( |
... | further graphical arguments, see |
See Also
plot.factor
, the plot
method for factors.
Examples
## 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= *)")
Copyright (©) 1999–2012 R Foundation for Statistical Computing.
Licensed under the GNU General Public License.