plot.formula              package:base              R Documentation

_F_o_r_m_u_l_a _N_o_t_a_t_i_o_n _f_o_r _S_c_a_t_t_e_r_p_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Specify a scatterplot or add points or lines via a formula.

_U_s_a_g_e:

     plot.formula(formula, ..., data = parent.frame(), subset,
                  ylab = varnames[response], ask = TRUE)
     points.formula(formula, ..., data = parent.frame(), subset)
     lines.formula(formula, ..., data = parent.frame(), subset)
     plot(y ~ x, ...)
     points(y ~ x, ...)
     lines(y ~ x, ...)

_A_r_g_u_m_e_n_t_s:

 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.

    ylab: the y label of the plot(s)

     ...: Further graphical parameters may also be passed as arguments,
          see `par'

     ask: logical, see `par'.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     These functions are invoked for their side effect of drawing  in
     the active graphics device.

_S_e_e _A_l_s_o:

     `plot.default', `plot.factor'.

_E_x_a_m_p_l_e_s:

     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)

