plot.formula            package:graphics            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:

     ## 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)

_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.

     ...: Further graphical parameters may also be passed as arguments,
          see 'par'.  'horizontal = TRUE' is also accepted.

  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 '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)'.

     Missing values are not considered in these methods, and in
     particular cases with missing values are not removed.

     If 'y' is an object (ie. 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 used (see 'boxplot').

_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)

