home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / abline < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.2 KB  |  36 lines

  1.     
  2.     _A_d_d _a _S_t_r_a_i_g_h_t _L_i_n_e _t_o _a _P_l_o_t
  3.     
  4.          abline(a, b, ...)
  5.          abline(h=, ...)
  6.          abline(v=, ...)
  7.          abline(coef=, ...)
  8.          abline(reg=, ...)
  9.     
  10.     _V_a_l_u_e:
  11.     
  12.          This function is invoked for its side effects, which is
  13.          to add one or more straight lines through the current
  14.          plot.  The first form above specifies the line in
  15.          intercept/slope form (alternatively a can be specified
  16.          on its own and is taken to contain the slope and inter-
  17.          cept in vector form).  The h= and v= forms draw hor-
  18.          izontal and vertical lines at the specified coordi-
  19.          nates.  The coef form specifies the line by a vector
  20.          containing the slope and intercept.  reg is a regres-
  21.          sion object which contains reg$coef.  If it is of
  22.          length 1 then the value is taken to be the slope of a
  23.          line through the origin, otherwise, the first 2 values
  24.          are taken to be the slope and intercept.
  25.     
  26.          The graphical parameters col and lty can be specified
  27.          as arguments to abline; see par for details.
  28.     
  29.     _E_x_a_m_p_l_e_s:
  30.     
  31.          data(cars)
  32.          z <- lm(dist ~ speed, data=cars)
  33.          plot(cars)
  34.          abline(z)
  35.     
  36.