lines.loess: Adds connected line segments to a plot using a fitted loess

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Adds connected line segments of a loess fitted structure to a plot similar to how lines() works for lowess().

Usage

1
2
## S3 method for class 'loess'
lines(x, subset=NULL, ...)

Arguments

x

An object of class loess.

subset

The subset of the data points in the fit to be used for drawing the line. If a single integer or a proportion between 0 and 1 is given, a sample of that number of data points or proportion, respectively, will be drawn (guaranteed to include the left and right most data points) and used as the subset. If NULL, all data points are included.

...

Arguments that are accepted by lines.

Details

Specifying the subset of data points to be plotted as an integer or as as proportion of the number of data points, e.g. subset=0.1, is useful when the fitted data contains a lot of data points. This is especially a concern when vector graphics such as postscript images are generated where each single subline drawn takes time to display and takes up memory.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

loess, lowess, lines.

Examples

1
2
3
4
5
6
7
   library(stats)   # loess()
   data(cars)
   # draw a smooth line through a scatter plot
   plot(cars, main="Stopping Distance versus Speed")
   lines(lowess(cars), col="blue")
   fit <- loess(dist~speed, data=cars, family="symmetric")
   lines(fit, col="red")

HenrikBengtsson/R.basic documentation built on May 6, 2019, 11:51 p.m.