Formula Notation for Scatterplots

Usage

plot.formula(formula, data = NULL, subset, na.action, ..., ask = TRUE)
plot(y ~ x, ...)

Arguments

formula a formula, such as y ~ x.
data a data.frame (or list) from which the variables in formula should be taken.
subset an optional vector specifying a subset of observations to be used in the fitting process.
na.action a function which indicates what should happen when the data contain NAs. The default action (na.omit) is to omit any incomplete observations. The alternative action na.fail causes plot to print an error message and terminate if there are any incomplete observations.
... graphical parameters may also be passed as arguments, see par. These can include ylab, which if not supplied is set by plot.formula.
ask logical, see par.

Value

This function is invoked for its side effect of drawing a scatter plot in the active graphics window.

See Also

plot.default, plot.factor.

Examples

data(swiss)
op <- par(mfrow=c(2,1))
plot(Fertility ~ Education, data = swiss)
plot(Fertility ~ Education, data = swiss, subset = Education < 20)
par(op)


[Package Contents]