For the lines
, points
and text
methods the formula
should be of the form y ~ x
or y ~ 1
with a left-hand
side and a single term on the right-hand side. The plot
method
accepts other forms discussed later in this section. 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
. A plot against the running index can be specified as
plot(y ~ 1)
.
If the formula in the plot
method contains more than one term
on the right-hand side, a series of plots is produced of the response
against each non-response term.
For the plot
method the formula can be of the form
~ z + y + z
: the variables specified on the right-hand side are
collected into a data frame, subsetted if specified, and displayed by
plot.data.frame
.
Missing values are not considered in these methods, and in particular
cases with missing values are not removed.
If y
is an object (i.e., has a class
attribute)
then plot.formula
looks for a plot method for that class first.
Otherwise, the class of x
will determine the type of the plot.
For factors this will be a parallel boxplot, and argument
horizontal = TRUE
can be specified (see boxplot
).
Note that some arguments will need to be protected from premature
evaluation by enclosing them in quote
: currently this is
done automatically for main
, sub
and xlab
. For
example, it is needed for the panel.first
and panel.last
arguments passed to plot.default
.