Re: R-beta: spline problems(?)

Jim Lindsey (jlindsey@luc.ac.be)
Tue, 7 Apr 1998 08:54:06 +0200 (MET DST)


From: Jim Lindsey <jlindsey@luc.ac.be>
Message-Id: <9804070654.AA08451@alpha.luc.ac.be>
Subject: Re: R-beta: spline problems(?)
To: tsioltas@cs.keele.ac.uk (A. Tsiolakidis)
Date: Tue, 7 Apr 1998 08:54:06 +0200 (MET DST)
In-Reply-To: <35298FC9.70AA@cs.keele.ac.uk> from "A. Tsiolakidis" at Apr 7, 98 03:30:33 am

I suspect that this is a problem that I pointed out some time ago with
integers. seq and : produce integers and the C code of spline is
expected doubles. Try as.double() around your 1:nrow(y) and seq()
calls to see if the problem goes away.
Jim

> 
> Hi,
> 
> I am a total beginner with this whole thing so please have patience!
> 
> I am trying to run an S-plus program with a certain line:
> 	spline(1:nrow(y), y[,1],n=100);
> 
> This crashes with:
> 	Error: NAs in foreign function call (arg 8)
> 
> Apparently, this is caused by the last command of spline:
> 	u <- seq(xmin, xmax, length.out = n)
>         .C("spline_eval", z$method, length(u), x = u, y = double(n), 
>                 z$n, z$x, z$y, z$b, z$c, z$d)[c("x", "y")]
> }
> 
> Now, I can cause that error with: spline(1:10,1:10)
> So, there  is a whole class of problems for which spline refuses to
> compute anything - is this the correct behaviour? E.g.,
> 	spline(1:10,(1:10)/2.5) #it is alright, but ...
> 	spline(1:10,(1:10)/2)   # this has the "NAs.." problem
> 
> Finally, I am almost sure that the y matrix in my program has quite
> normal values, i.e. values that should allow for meaningful
> interpolation.
> Anybody knows what this all is about?
> 
> Thanks,
> 
> Tasos T.
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._