library(agricolae)
x<-c(1,3,5,2,3,1)
y<-c(2,5,4,3,2,3)
z<-c(4,10,NA,6,7,NA)
modelo<-lm(z~x+y)
zz<-wxyz(modelo,x,y,z)
# The response surface
x<-as.numeric(rownames(zz))
y<-as.numeric(colnames(zz))
#startgraph
persp(x,y,zz, cex=0.7,theta = -20, phi = 30,shade= 0.2,nticks = 6, col = 'green' ,
ticktype = 'detailed',xlab = 'X', ylab = 'Y', zlab = 'Response')
#endgraph
Run the code above in your browser using DataLab