\Header{lines}{Add Connected Line Segments to a Plot}
\methalias{lines.default}{lines}
\keyword{aplot}{lines}
\begin{Description}\relax
A generic function taking coordinates given in various ways and
joining the corresponding points with line segments.\end{Description}
\begin{Usage}
\begin{verbatim}
lines(x, ...)
lines.default(x, y=NULL, type="l", col=par("col"), lty=par("lty"), ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x, y}] coordinate vectors of points to join.
\item[\code{type}] character indicating the type of plotting; actually any of
the \code{type}s as in \code{\Link{plot}}.
\item[\code{col}] color to use.
\item[\code{lty}] line type to use.
\item[\code{...}] Further graphical parameters (see \code{\Link{par}}) may
also be supplied as arguments, particularly, line type, \code{lty} and
line width, \code{lwd}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The coordinates can be passed to \code{lines} in a plotting structure
(a list with \code{x} and \code{y} components), a time series,
etc. See \code{\Link{xy.coords}}.

The coordinates can contain \code{NA} values. If a point contains
\code{NA} it either its \code{x} or \code{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.\end{Details}
\begin{SeeAlso}\relax
\code{\Link{points}},
\code{\Link{plot}},
and the underlying ``primitive'' \code{\Link{plot.xy}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(cars)
# draw a smooth line through a scatter plot
plot(cars, main="Stopping Distance versus Speed")
lines(lowess(cars))
\end{ExampleCode}
\end{Examples}

