Re: [R] interpolation issue

2012-04-18 Thread Petr Savicky
On Wed, Apr 18, 2012 at 07:15:45AM -0700, uday wrote: > hi Petr , > Thanks for replay and sorry for typo mistake > approx(pres, sci.pre) its nothing but approx(pre2, pre1). > > so for more simplicity > x <- c(10.34615 , 52.02116, 146.17357, 243.28644, 347.41504, 431.67105, > 521.4

Re: [R] interpolation issue

2012-04-18 Thread R. Michael Weylandt
Your problem is that length(x) != length(y) approx uses linear interpolation but there's no way to make sense of that if you can't match up the x and y coordinates -- and you can't match up the x and y coordinates if there aren't the same number of them. Michael On Wed, Apr 18, 2012 at 10:15 AM,

Re: [R] interpolation issue

2012-04-18 Thread uday
hi Petr , Thanks for replay and sorry for typo mistake approx(pres, sci.pre) its nothing but approx(pre2, pre1). so for more simplicity x <- c(10.34615 , 52.02116, 146.17357, 243.28644, 347.41504, 431.67105, 521.42712, 629.00446 ,729.95941, 827.86279, 921.55078, 956.6) y <- c(

Re: [R] interpolation issue

2012-04-18 Thread Petr Savicky
On Wed, Apr 18, 2012 at 03:55:07AM -0700, uday wrote: > This moment I got stuck with one interpolation issue > the sample data which I have is as follows > > pre1 <- c(10.34615 , 52.02116, 146.17357, 243.28644, 347.41504, 431.67105, > 521.42712, 629.00446 ,729.95941,82

[R] interpolation issue

2012-04-18 Thread uday
This moment I got stuck with one interpolation issue the sample data which I have is as follows pre1 <- c(10.34615 , 52.02116, 146.17357, 243.28644, 347.41504, 431.67105, 521.42712, 629.00446 ,729.95941,827.86279, 921.55078, 956.6) pre2 <- c( 983.4477692, 973.619