[Rd] interpolation using akima (PR#8174)

jonathan_lees@unc.edu jonathan_lees at unc.edu
Mon Oct 3 18:13:16 CEST 2005


Full_Name: Jonathan Lees
Version: 2.0.1
OS: linux-gnu
Submission from: (NULL) (152.2.75.65)


there is a problem with calculating the convex hull in 2-D interpolation using
the codes interp fromt eh akima package:

x =c(0.6505304, -1.1821562, -0.2600792,  0.7913716)
y = c(1.0424226,  0.1754048, -1.4523334,  0.2349112)
z =  c(0.000, 3.042, 0.370, 0.122)


   EX = seq(from=min(x), to=max(x), length=100)
    WHY = seq(from=min(y), to=max(y), length=100)

 ZZ = interp(x=x, y=y, z=z, xo=EX, yo=WHY, extrap=FALSE)

plot(x,y, type='n')
image(ZZ, add=TRUE)
points(x,y)
text(x,y,labels=z)

BUG:
Notice the convex hull is wrong.
It includes only 3 of the 4 points provided.
If you add another point near by it does some
really wierd stuff.
x = c(x,  -0.3950865)
y = c(y,  -1.449117)
z = c(z, .37)



I do not think it should behave in this manner.



More information about the R-devel mailing list