Re: [R] Connect observed values by a smooth curve, is there any method to get coordinate value of arbitrary point on the curve?

From: Zhipeng Wang <>
Date: Sat, 02 Apr 2011 00:21:28 +0900

Dear Prof. Murdoch and Dr. Winsemius,

Thank you very much for your suggestion. They were big help. One of my friends told me another approach by using "smooth.spline". Here is the code:

x <- c(1,2,3,4,5,6)
y <- c(1,4,9,16,25,36)
sp <- smooth.spline(x,y)
x <- seq(1, 6, length=100)
pred <- predict(sp, x)
real <- x^2
err <- real - pred$y
cbind(pred$x, pred$y, real, err)

Thank a lot. Have a nice weekend :)

Wang Zhipeng

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 01 Apr 2011 - 15:24:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 01 Apr 2011 - 15:40:26 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive