Learn R Programming

qualityTools (version 1.31.1)

wirePlot: 3D Plot

Description

Creates a wireframe diagramm for an object of class facDesign

Usage

wirePlot(x, y, z, data = NULL, xlim, ylim, zlim, main, xlab, ylab, border, sub, zlab, form = "fit", phi, theta, ticktype, col = 1, steps, factors, fun, plot)

Arguments

x
Factor A
y
Factor B
z
Response variable
data
an object of class facDesign
xlim
graphical parameter
ylim
graphical parameter
zlim
graphical parameter
main
graphical parameter
xlab
graphical parameter
ylab
graphical parameter
border
the color of the line drawn around the surface facets
sub
the subtitle
zlab
graphical parameter
form
quadratic, full, interaction, linear, fit or a formula y ~ x+y +x*y; fit takes the formula from the fit in the facDesign object fdo. Quadratic or higher
phi
angle defining the viewing direction. theta gives the azimuthal direction. phi gives the colatitude.
theta
angle defining the viewing direction. theta gives the azimuthal direction.
ticktype
graphical parameter
col
a predefined (1, 2, 3 or 4) or self defined colorRampPalette or color to be used (i.e. red)
steps
number of grid points per factor
factors
list of 4th 5th factor with value i.e. factors = list(D = 1.2, E = -1), if nothing is specified values will be the mean of the low and the high value of the factors
fun
function to be applied to z desirability
plot
if TRUE a plot is created (most likely to disappear with time)

Value

  • xlocations of grid lines for x at which the values in z are measured
  • ylocations of grid lines for y at which the values in z are measured
  • za matrix containing the values of z to be plotted

Details

This function can be used to display the desirability of each response by specifying fun = desirability or the fun = overall (i.e. composed) desirability of all responses. The required desirabilities can be set using desires.

See Also

contourPlot, filled.contour, persp

Examples

Run this code
#create a response surface design and assign random data to response y
fdo = rsmDesign(k = 3, blocks = 2)
response(fdo) = data.frame(y = rnorm(nrow(fdo)))

par(mfrow = c(3,2))

#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
fits(fdo) = lm(y ~ B + I(A^2) , data = fdo)
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)

#V - display a fit using a self defined colorRamp
myColour = colorRampPalette(c("green", "gray","blue"))
wirePlot(A,B,y, data = fdo, form = "full", col = myColour)

Run the code above in your browser using DataLab