| 42333 |
ripley |
1 |
% File src/library/graphics/man/plot.dataframe.Rd
|
| 68948 |
ripley |
2 |
% Part of the R package, https://www.R-project.org
|
| 67599 |
ripley |
3 |
% Copyright 1995-2014 R Core Team
|
| 42333 |
ripley |
4 |
% Distributed under GPL 2 or later
|
|
|
5 |
|
| 27442 |
ripley |
6 |
\name{plot.data.frame}
|
| 56186 |
murdoch |
7 |
\alias{plot.data.frame}
|
| 27442 |
ripley |
8 |
\title{Plot Method for Data Frames}
|
|
|
9 |
\description{
|
| 32214 |
ripley |
10 |
\code{plot.data.frame}, a method for the \code{\link{plot}} generic.
|
|
|
11 |
It is designed for a quick look at numeric data frames.
|
| 27442 |
ripley |
12 |
}
|
|
|
13 |
\usage{
|
| 89484 |
deepayan |
14 |
\method{plot}{data.frame}(x, formula = NULL, \dots)
|
| 27442 |
ripley |
15 |
}
|
|
|
16 |
\arguments{
|
|
|
17 |
\item{x}{object of class \code{data.frame}.}
|
| 89484 |
deepayan |
18 |
\item{formula}{ optional formula, as in \code{\link{plot.formula}}. }
|
|
|
19 |
\item{\dots}{further arguments to \code{\link{plot.formula}},
|
|
|
20 |
\code{\link{stripchart}}, \code{\link{plot.default}} or
|
|
|
21 |
\code{\link{pairs}}. }
|
| 27442 |
ripley |
22 |
}
|
| 32212 |
ripley |
23 |
\details{
|
| 32214 |
ripley |
24 |
This is intended for data frames with \emph{numeric} columns. For more
|
|
|
25 |
than two columns it first calls \code{\link{data.matrix}} to convert
|
|
|
26 |
the data frame to a numeric matrix and then calls \code{\link{pairs}}
|
| 74363 |
maechler |
27 |
to produce a scatterplot matrix. This can fail and may well be
|
| 32214 |
ripley |
28 |
inappropriate: for example numerical conversion of dates will lose
|
|
|
29 |
their special meaning and a warning will be given.
|
|
|
30 |
|
|
|
31 |
For a two-column data frame it plots the second column against the
|
|
|
32 |
first by the most appropriate method for the first column.
|
| 61433 |
ripley |
33 |
|
| 32214 |
ripley |
34 |
For a single numeric column it uses \code{\link{stripchart}}, and for
|
|
|
35 |
other single-column data frames tries to find a plot method for the
|
|
|
36 |
single column.
|
| 89484 |
deepayan |
37 |
|
|
|
38 |
In case a \code{formula} is provided, the \code{\link{plot.formula}}
|
|
|
39 |
method is called, allowing a simpler invocation of the formula method
|
| 90049 |
hornik |
40 |
using the \link[base:pipeOp]{pipe operator}.
|
| 32212 |
ripley |
41 |
}
|
| 27442 |
ripley |
42 |
\seealso{
|
|
|
43 |
\code{\link{data.frame}}
|
|
|
44 |
}
|
|
|
45 |
\examples{
|
| 61153 |
ripley |
46 |
plot(OrchardSprays[1], method = "jitter")
|
| 27442 |
ripley |
47 |
plot(OrchardSprays[c(4,1)])
|
|
|
48 |
plot(OrchardSprays)
|
| 89484 |
deepayan |
49 |
plot(OrchardSprays, decrease ~ treatment)
|
| 32214 |
ripley |
50 |
|
|
|
51 |
plot(iris)
|
|
|
52 |
plot(iris[5:4])
|
|
|
53 |
plot(women)
|
| 27442 |
ripley |
54 |
}
|
|
|
55 |
\keyword{hplot}
|
|
|
56 |
\keyword{methods}
|