[R] smooth curves

Martin Maechler maechler at stat.math.ethz.ch
Fri Dec 6 12:53:02 CET 2002


>>>>> "guerreau" == guerreau  <alain.guerreau at fnac.net>
>>>>>     on Fri, 6 Dec 2002 11:21:48 +0100 writes:

    guerreau> I would like to draw smooth curves instead of
    guerreau> polygons.  I could not find any spline function to
    guerreau> do that : given an x and a y vectors, they all
    guerreau> take the x in increasing order.  Is there a
    guerreau> function to draw a smooth curve through a set of
    guerreau> points in any order ?

I've always wanted to try the following.
Your e-mail prompted me to.

I attach an R source file that shows one solution,
using interpolating spline(s), 
one through (t, x(t))
the other   (t, y(t))

Repeatedly sourcing this file also shows you the limitation of
splines for this situation.
The functions are for your convenience to do more experiments.

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: spline-non-function-curve.R
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20021206/b5cdb74c/spline-non-function-curve.pl


More information about the R-help mailing list