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.

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

