| 27442 |
ripley |
1 |
\name{plot.table}
|
|
|
2 |
\alias{plot.table}
|
|
|
3 |
\title{Plot Methods for `table' Objects}
|
|
|
4 |
\description{
|
|
|
5 |
This is a method of the generic \code{plot} function for
|
|
|
6 |
(contingency) \code{\link{table}} objects. Whereas for two- and more
|
|
|
7 |
dimensional tables, a \code{\link{mosaicplot}} is drawn,
|
|
|
8 |
one-dimensional ones are plotted \dQuote{bar like}.
|
|
|
9 |
}
|
|
|
10 |
\usage{
|
|
|
11 |
%% Improvement ideas: see code definition, currently in ../R/plot.R
|
|
|
12 |
\method{plot}{table}(x, type = "h", ylim = c(0, max(x)), lwd = 2,
|
|
|
13 |
xlab = NULL, ylab = NULL, frame.plot = is.num, \dots)
|
|
|
14 |
}
|
|
|
15 |
\arguments{
|
|
|
16 |
\item{x}{a \code{\link{table}} (like) object.}
|
|
|
17 |
\item{type}{plotting type.}
|
|
|
18 |
\item{ylim}{range of y-axis.}
|
|
|
19 |
\item{lwd}{line width for bars when \code{type = "h"} is used in the 1D case.}
|
|
|
20 |
\item{xlab, ylab}{x- and y-axis labels.}
|
|
|
21 |
\item{frame.plot}{logical indicating if a frame (\code{\link{box}})
|
|
|
22 |
should be drawn in the 1D case. Defaults to true when \code{x} has
|
|
|
23 |
\code{\link{dimnames}} coerceable to numbers.}
|
|
|
24 |
\item{\dots}{further graphical arguments, see \code{\link{plot.default}}.}
|
|
|
25 |
}
|
|
|
26 |
\details{
|
|
|
27 |
The current implementation (R 1.2) is somewhat experimental and will
|
|
|
28 |
be improved and extended.
|
|
|
29 |
}
|
|
|
30 |
\seealso{\code{\link{plot.factor}}, the \code{\link{plot}} method for factors.}
|
|
|
31 |
|
|
|
32 |
\examples{
|
|
|
33 |
## 1-d tables
|
|
|
34 |
(Poiss.tab <- table(N = rpois(200, lam= 5)))
|
|
|
35 |
plot(Poiss.tab, main = "plot(table(rpois(200, lam=5)))")
|
|
|
36 |
|
|
|
37 |
data(state)
|
|
|
38 |
plot(table(state.division))
|
|
|
39 |
|
|
|
40 |
## 4-D :
|
|
|
41 |
data(Titanic)
|
|
|
42 |
plot(Titanic, main ="plot(Titanic, main= *)")
|
|
|
43 |
|
|
|
44 |
}
|
|
|
45 |
\keyword{hplot}
|
|
|
46 |
\keyword{category}
|