The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
27442 ripley 1
\name{plot.factor}
2
\title{Plotting Factor Variables}
3
\usage{
4
\method{plot}{factor}(x, y, legend.text = levels(y), \dots)
5
}
6
\alias{plot.factor}
7
\arguments{
8
    \item{x,y}{numeric or factor.  \code{y} may be missing.}
9
    \item{legend.text}{a vector of text used to construct a legend for
10
        the plot. Only used if \code{y} is present and a factor.}
11
    \item{\dots}{Further arguments to \code{\link{plot}}, see also
12
        \code{\link{par}}.}
13
}
14
\description{
15
  This functions implements a \dQuote{scatterplot} method for
16
  \code{\link{factor}} arguments of the \emph{generic}
17
  \code{\link{plot}} function.
18
  Actually, \code{\link{boxplot}} or \code{\link{barplot}} are used when
19
  appropriate.
20
}
21
\seealso{
22
    \code{\link{plot.default}}, \code{\link{plot.formula}},
23
    \code{\link{barplot}}, \code{\link{boxplot}}.
24
}
25
\examples{
26
data(PlantGrowth)
27
plot(PlantGrowth)                                # -> plot.data.frame
28
plot(weight ~ group, data = PlantGrowth)         # numeric vector ~ factor
29
plot(cut(weight, 2) ~ group, data = PlantGrowth) # factor ~ factor
30
## passing "..." to barplot() eventually:
31
plot(cut(weight, 3) ~ group, data = PlantGrowth, density = 16*(1:3),col=NULL)
32
 
33
plot(PlantGrowth$group, axes=FALSE, main="no axes")# extremly silly
34
}
35
\keyword{hplot}