library(e1071)
library(agricolae)
data(ralstonia)
arc<-c(4, 32, 24, 12, 8, 14, 28, 22, 14, 20, 6, 10, 24)
days <- c(2,15,29,43,58,73)
zz<-as.matrix(ralstonia)
dimnames(zz)<-list(arc,days)
fzz<-gxyz(zz)
x<-fzz[[1]]
y<-fzz[[2]]
z<-fzz[[3]]
modelo<-lm(z~x+y+x*y+I(x^2)+I(y^2) )
# it completes and it orders the information matrix z1 <- [x,y,z]
z1<-wxyz(modelo,x,y,z)
m<-40
n<-15
# It generates a new matrix mxn with but points by interpolation.
z2<-grid3d(z1,m,n)
# Surface of response
x2<-as.numeric(rownames(z2))
y2<-as.numeric(colnames(z2))
#startgraph
res<-persp(x2,y2,z2, cex=0.7,theta = 60, phi = 30,shade= 0.2,nticks = 6, col = "yellow" ,
ticktype = "detailed",xlab = "clay", ylab = "days", zlab = "Ralstonia")
mtext("Ralstonia solanacearum population",side=3,cex=0.9,font=4)
#endgraph
Run the code above in your browser using DataLab