lines                package:graphics                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, ...)

     ## Default S3 method:
     lines(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. This can be vector of length greater than one,
          but only the first value will be used.

     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'
     in either its 'x' or 'y' value, it is omitted from the plot, and
     lines are not drawn to or from such points.  Thus missing values
     can be used to achieve breaks in lines.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

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

     'par' for how to specify colors.

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

