fit<- Tps( BD[,1:4], BD$lnya) # fit surface to data
# make grid list
grid.list<- list( KCl="x", MgCl2=mean(BD[,2]),KPO4="y",dNTP=mean(BD[,4]))
out.p<- predict.surface(fit,grid.list, extrap=T)
# evaluate on a grid on two
# variables holding two fixed
surface(out.p)
# surface and contour plot
Run the code above in your browser using DataLab