plot.formula {base} | R Documentation |
Specify a scatterplot or add points or lines via a formula.
## S3 method for class 'formula'
plot(formula, data = parent.frame(), ..., subset,
ylab = varnames[response], ask = TRUE)
## S3 method for class 'formula'
points(formula, data = parent.frame(), ..., subset)
## S3 method for class 'formula'
lines(formula, data = parent.frame(), ..., subset)
formula |
a |
data |
a data.frame (or list) from which the variables in
|
... |
Further graphical parameters may also be passed as
arguments, see |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
ylab |
the y label of the plot(s). |
ask |
logical, see |
Both the terms in the formula and the ...
arguments are
evaluated in data
enclosed in parent.frame()
if
data
is a list or a data frame. The terms of the formula and
those arguments in ...
that are of the same length as
data
are subjected to the subsetting specified in
subset
. If the formula in plot.formula
contains more
than one non-response term, a series of plots of y against each term
is given. A plot against the running index can be specified as
plot(y~1)
.
If y
is an object (ie. has a class
attribute)
then plot.formula
looks for a plot method for that class first.
These functions are invoked for their side effect of drawing in the active graphics device.
plot.default
, plot.factor
.
data(airquality)
op <- par(mfrow=c(2,1))
plot(Ozone ~ Wind, data = airquality, pch=as.character(Month))
plot(Ozone ~ Wind, data = airquality, pch=as.character(Month),
subset = Month != 7)
par(op)