[R] order of points in spline

Greg Snow Greg.Snow at imail.org
Fri Nov 6 22:48:04 CET 2009


The spline function (and loess and others) fit regression splines (or approximations) meaning that each value of x maps to only 1 value of y.  If you want a curve that goes through points in the specified order and is able to wrap back then you probably want the xspline function.  See its help page for details.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Nicola Romanò
> Sent: Friday, November 06, 2009 2:07 PM
> To: r-help at r-project.org
> Subject: Re: [R] order of points in spline
> 
> > Huh?
> >
> > Prevent spline from using (x[n],y[n]) as the coordinates of the
> n^{th} data point?
> >
> > Why on earth would you want to do that?
> >
> 
> Maybe I did not explain myself correctly.
> 
> My first three points have x:  262, 275, 264
> 
> I want the spline to go from point 1 (x=262) to point 2 (x=275) and
> then go back on the x axis to point 3 (x=264).
> The function goes from 1 (x=262) to 3 (x=264) to 2 (x=275)
> 
> Please, run my example and you should see for yourself.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list