[R] order of points in spline

_nico_ romano.nicola at gmail.com
Mon Nov 9 10:14:14 CET 2009


At the end, although the xspline function suggested by Greg did what I
needed, it suffers from the fact that you cannot specify the number of
points of the output curve.
I then wrote my function for a generic nth grade Bezier curve interpolation. 
You can find the code here if ever you're interested.
http://rosettacode.org/wiki/Cubic_bezier_curves#R

>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.

______________________________________________
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.



-- 
View this message in context: http://old.nabble.com/order-of-points-in-spline-tp26230875p26263217.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list