lines                  package:base                  R Documentation

_A_d_d _C_o_n_n_e_c_t_e_d _L_i_n_e _S_e_g_m_e_n_t_s _t_o _a _P_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     A generic function taking coordinates given in various ways and
     joining the corresponding points with line segments.

_U_s_a_g_e:

     lines(x, ...)
     lines.default(x, y=NULL, type="l", col=par("col"), lty=par("lty"), ...)

_A_r_g_u_m_e_n_t_s:

    x, y: coordinate vectors of points to join.

    type: character indicating the type of plotting; actually any of
          the `type's as in `plot(..)'.

     col: color to use.

     lty: line type to use.

     ...: Further graphical parameters (see `par') may also be supplied
          as arguments, particularly, line type, `lty' and line width,
          `lwd'.

_D_e_t_a_i_l_s:

     The coordinates can be passed to `lines' in a plotting structure
     (a list with `x' and `y' components), a time series, etc. See
     `xy.coords'.

     The coordinates can contain `NA' values. If a point contains `NA'
     it either its `x' or `y' value, it is omitted from the plot, and
     liens are not drawn to or from such points.  Thus missing values
     can be used to achieve breaks in lines.

_S_e_e _A_l_s_o:

     `points', `plot', and the underlying ``primitive'' `plot.xy'.

_E_x_a_m_p_l_e_s:

     data(cars)
     # draw a smooth line through a scatter plot
     plot(cars, main="Stopping Distance versus Speed")
     lines(lowess(cars))

