[R] smooth curves
Prof Brian D Ripley
ripley at stats.ox.ac.uk
Fri Dec 6 16:40:04 CET 2002
On 6 Dec 2002, Michael A. Miller wrote:
> >>>>> "guerreau" == guerreau <alain.guerreau at fnac.net> writes:
>
> > I would like to draw smooth curves instead of polygons. I
> > could not find any spline function to do that : given an x
> > and a y vectors, they all take the x in increasing order.
> > Is there a function to draw a smooth curve through a set of
> > points in any order ?
>
> The locfit package local regression, likelihood and density
> estimation) can be used to that:
>
> library(locfit)
> data(ethanol)
> fit <- locfit(NOx~E,data=ethanol)
> plot(NOx~E,data=ethanol)
> lines(fit)
1) That package is in CRAN/Devel because it does not work (fully) with
current R.
2) Your example is of a *smoothed* fit, not of a smooth interpolating
curve.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list