# Example 1: Basic wireframe plot
x <- seq(-10, 10, length = 30)
y <- seq(-10, 10, length = 30)
z <- outer(x, y, function(a, b) sin(sqrt(a^2 + b^2)))
wirePlot(x, y, z, main = "3D Wireframe Plot", xlab = "X-Axis", ylab = "Y-Axis", zlab = "Z-Axis")
fdo = rsmDesign(k = 3, blocks = 2)
fdo$.response(data.frame(y = rnorm(fdo$nrow())))
#I - display linear fit
wirePlot(A,B,y, data = fdo, form = "linear")
#II - display full fit (i.e. effect, interactions and quadratic effects
wirePlot(A,B,y, data = fdo, form = "full")
#III - display a fit specified before
fdo$set.fits(fdo$lm(y ~ B + I(A^2)))
wirePlot(A,B,y, data = fdo, form = "fit")
#IV - display a fit given directly
wirePlot(A,B,y, data = fdo, form = "y ~ A*B + I(A^2)")
#V - display a fit using a different colorRamp
wirePlot(A,B,y, data = fdo, form = "full", col = 2)
Run the code above in your browser using DataLab