[R] What is the easiest way to interpolate vertical values on a square section of a nearly-planar 3D surface

Nerd of Darkness floridmercutio at yahoo.com
Wed Dec 4 04:09:48 CET 2013



On 2013年12月04日 08:21, David Winsemius wrote:
> library(car)
> # will also need rgl
> scatter3d(dat$X, dat$Y, dat$Value)
> 
> library(akima)
> akima.li <- interp(dat$X, dat$Y, dat$Value, 
>                    xo=seq(min(dat$X), max(dat$X), length = 100),
>                    yo=seq(min(dat$Y), max(dat$Y), length = 100))
> 
> persp(akima.li$z)
>  persp(akima.li$z, theta=30)
>  persp(akima.li$z, theta=45)
>  persp(akima.li$z, theta=60)
> 

The scatter3d was very impressive; in case other folks are following
along, I should note that I had to do

sudo apt-get install libglu1-mesa-dev

in order to get rgl to install x11 properly, but after that, the
animated interactive graphics were amazing, so thank you very much for
introducing me to that.

The akima package appears to be the best way to move forward on
interpolating the data.  I will try to use akima to make a slightly more
detailed grid and then try to put the output into contour.

Thanks!



More information about the R-help mailing list