Hi, I want to use the result from smooth.spline outside R. I take my data ,which is 180 point stored in x and y s <- smooth(x,y) I can know use to e.g. find the interpolated value at e.g. x=500 predict (s,500) My problem is, that i don't know how to implement the predict function. I have looked at literature, but i cannot connect the output of the smooth.spline() to an actual spline model.. Has anyone tried it? Br Jesper -- View this message in context: http://r.789695.n4.nabble.com/Application-of-results-from-smooth-spline-outside-R-tp3767610p3767610.html Sent from the R help mailing list archive at Nabble.com.
Jean V Adams
2011-Aug-25 12:34 UTC
[R] Application of results from smooth.spline outside R
I'm assuming that you meant to write s <- smooth.spline(x, y) You can look at the code for the predict method for smooth.spline by typing getAnywhere(predict.smooth.spline) If a new value is provided (i.e., the 500 in your example) then the predict method for smooth.spline.fit is applied to the spline object's fit (i.e., s$fit in your example). You can look at the code for the predict method for smooth.spline.fit by typing getAnywhere(predict.smooth.spline.fit) Jean Jesper wrote on 08/25/2011 03:03:09 AM:> > Hi, > > I want to use the result from smooth.spline outside R. > > I take my data ,which is 180 point stored in x and y > > s <- smooth(x,y) > > I can know use to e.g. find the interpolated value at e.g. x=500 > > predict (s,500) > > My problem is, that i don't know how to implement the predict function.I> have looked at literature, but i cannot connect the output of the > smooth.spline() to an actual spline model.. > > Has anyone tried it? > > Br > > Jesper >[[alternative HTML version deleted]]
Hi Jean, Thanks for the reply.. Using your suggestion, I end up in in the source code (Fortran 77 i believe). At first look, it seems a bit more tedious to implement than I expected. -- View this message in context: http://r.789695.n4.nabble.com/Application-of-results-from-smooth-spline-outside-R-tp3767610p3797118.html Sent from the R help mailing list archive at Nabble.com.
Spencer Graves
2011-Sep-07 22:00 UTC
[R] Application of results from smooth.spline outside R
Hi, Jesper: Where "Outside R" do you want to use it? There are R interfaces to many other software packages, and many that cannot easily link to R can link to Fortran. You could use library(sos) to search for R packages to connect to whatever. Hope this helps. Spencer On 9/7/2011 1:09 PM, Jesper wrote:> Hi Jean, > > Thanks for the reply.. > > Using your suggestion, I end up in in the source code (Fortran 77 i > believe). At first look, it seems a bit more tedious to implement than I > expected. > > -- > View this message in context: http://r.789695.n4.nabble.com/Application-of-results-from-smooth-spline-outside-R-tp3767610p3797118.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >
Reasonably Related Threads
- predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())
- page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))
- smooth.spline
- predict.smooth.spline
- smooth.spline() unique 'x' values error