# [R] Derivation of data points

From: <jessica.gervais_at_tudor.lu>
Date: Wed, 16 Jan 2008 11:35:15 +0100

Dear All,

I would like to make the derivation of a points. I tried to use D1tr (linear interpolation). I also tried to used D1ss (spline interpolation) but I do not realy know how to choose the smothing parameter the best. D1ss(x, y, xout = x, spar.offset = 0.1384, spl.spar=NULL)

Here is an example of data I would like to derive

library(sfsmisc)
x<-c(30:90)
y<-c(39.10111,39.71601,40.4367,41.11309,42.02203,42.96469,43.88154,44.72341,45.50918,46.29508,47.29949,48.30178,49.00582,49.7295,50.50255,51.24946,51.8912,52.49289,53.11462,53.61668,54.11853,54.61826,55.16866,55.70223,56.32028,57.10335,57.95425,58.9606,60.68077,61.2205,61.7642,62.51613,63.10644,64.12183,64.67105,66.62656,67.19005,68.16018,69.29873,69.64272,70.20944,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA)

D1tr()
D1ss(x, y, xout = x, spar.offset = 0.1384, spl.spar=NULL)

D1ss(x, y, xout = x, spar.offset = 0.1384, spl.spar=NULL) Error in smooth.spline(x, y) :
NA/NaN/Inf in foreign function call (arg 4)

Is there a way to return NA for points where there is an NA value as input ?

Could anyone give me some advices how to choose values for these "spar.offset" and "spl.spar" parameters ?

Jessica

Resource Centre for Environmental Technologies, Public Research Centre Henri Tudor,
Technoport Schlassgoart,
66 rue de Luxembourg,
P.O. BOX 144,
L-4002 Esch-sur-Alzette, Luxembourg

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. Received on Wed 16 Jan 2008 - 10:36:34 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 Wed 16 Jan 2008 - 11:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.