[R] 3-d splinefun

Colby Tanner ct_zero at yahoo.com
Fri Feb 10 05:44:23 CET 2006


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




More information about the R-help mailing list