| 42333 |
ripley |
1 |
% File src/library/graphics/man/plot.table.Rd
|
| 68948 |
ripley |
2 |
% Part of the R package, https://www.R-project.org
|
| 59362 |
ripley |
3 |
% Copyright 1995-2012 R Core Team
|
| 42333 |
ripley |
4 |
% Distributed under GPL 2 or later
|
|
|
5 |
|
| 27442 |
ripley |
6 |
\name{plot.table}
|
| 56186 |
murdoch |
7 |
\alias{plot.table}
|
| 52069 |
ripley |
8 |
\alias{lines.table}
|
|
|
9 |
\alias{points.table}
|
| 54540 |
hornik |
10 |
\title{Plot Methods for \code{table} Objects}
|
| 27442 |
ripley |
11 |
\description{
|
|
|
12 |
This is a method of the generic \code{plot} function for
|
|
|
13 |
(contingency) \code{\link{table}} objects. Whereas for two- and more
|
|
|
14 |
dimensional tables, a \code{\link{mosaicplot}} is drawn,
|
| 42961 |
ripley |
15 |
one-dimensional ones are plotted as bars.
|
| 27442 |
ripley |
16 |
}
|
|
|
17 |
\usage{
|
|
|
18 |
\method{plot}{table}(x, type = "h", ylim = c(0, max(x)), lwd = 2,
|
| 30695 |
ripley |
19 |
xlab = NULL, ylab = NULL, frame.plot = is.num, \dots)
|
| 54541 |
ripley |
20 |
\method{points}{table}(x, y = NULL, type = "h", lwd = 2, \dots)
|
|
|
21 |
\method{lines}{table}(x, y = NULL, type = "h", lwd = 2, \dots)
|
| 27442 |
ripley |
22 |
}
|
|
|
23 |
\arguments{
|
|
|
24 |
\item{x}{a \code{\link{table}} (like) object.}
|
| 54541 |
ripley |
25 |
\item{y}{Must be \code{NULL}: there to protect against incorrect calls.}
|
| 27442 |
ripley |
26 |
\item{type}{plotting type.}
|
|
|
27 |
\item{ylim}{range of y-axis.}
|
|
|
28 |
\item{lwd}{line width for bars when \code{type = "h"} is used in the 1D case.}
|
|
|
29 |
\item{xlab, ylab}{x- and y-axis labels.}
|
|
|
30 |
\item{frame.plot}{logical indicating if a frame (\code{\link{box}})
|
|
|
31 |
should be drawn in the 1D case. Defaults to true when \code{x} has
|
| 40281 |
ripley |
32 |
\code{\link{dimnames}} coerce-able to numbers.}
|
| 59362 |
ripley |
33 |
\item{\dots}{further graphical arguments, see \code{\link{plot.default}}.
|
|
|
34 |
\code{axes = FALSE} is accepted.}
|
| 27442 |
ripley |
35 |
}
|
| 50416 |
ripley |
36 |
\seealso{
|
|
|
37 |
\code{\link{plot.factor}}, the \code{\link{plot}} method for factors.
|
|
|
38 |
}
|
| 27442 |
ripley |
39 |
|
|
|
40 |
\examples{
|
|
|
41 |
## 1-d tables
|
| 41593 |
ripley |
42 |
(Poiss.tab <- table(N = stats::rpois(200, lambda = 5)))
|
|
|
43 |
plot(Poiss.tab, main = "plot(table(rpois(200, lambda = 5)))")
|
| 27442 |
ripley |
44 |
|
|
|
45 |
plot(table(state.division))
|
|
|
46 |
|
|
|
47 |
## 4-D :
|
|
|
48 |
plot(Titanic, main ="plot(Titanic, main= *)")
|
|
|
49 |
|
|
|
50 |
}
|
|
|
51 |
\keyword{hplot}
|
|
|
52 |
\keyword{category}
|