[R] 3-d splinefun

From: Colby Tanner <ct_zero_at_yahoo.com>
Date: Fri 10 Feb 2006 - 15:44:23 EST


hello,
is it possible to do something like splinefun(x,y), but with a 3rd dim?
for example, if i have a 2-dim system like: x<-1:100
y<-rexp(100,1)
func<-splinefun(x,sort(y))

func(n) # returns interpolated value of y (after sorting) given x=n

        # i can check this by:

plot(x,sort(y))
lines(spline(x,sort(y)))

Can i do the same thing with an x,y, and z? i have found the akima interp(x,y,z) for building 3-d images, but nothing about the function aspect. besides building a nice 3-dim image, i would like to have a way of finding the interpolated z values if i give an x and y coordinate. something like func(x,y) in the above example.

thank you,
colby



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Feb 10 20:07:57 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:27 EST