This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/lines.html
lines {base}R Documentation

Add Connected Line Segments to a Plot

Description

lines is a generic function taking the coordinates given in the x and y vectors and joining the corresponding points with line segments. The coordinates can alternatively be passed to lines in a plotting structure (a list with x and y components), a time series, etc.

Usage

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

Arguments

x, y

coordinate vectors of points to join.

type

character indicating the type of plotting; actually any of the types as in plot(..).

col

color to use.

...

Further graphical parameters (see par) may also be supplied as arguments, e.g., lty.

See Also

points, plot, and the underlying “primitive” plot.xy.

Examples

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

[Package base version 0.60 ]