contourPlot: Contour Plot

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Creates a contour diagramm for an object of class facDesign.

Usage

1
2
contourPlot(x, y, z, data = NULL, xlim, ylim, main, xlab, ylab, form = "fit", 
            col = 1, steps, factors, fun)

Arguments

x

name providing the Factor A for the plot.

y

name providing the Factor B for the plot.

z

name giving the Response variable.

data

needs to be an object of class facDesign and contains the names of x,y,z.

xlim

vector giving the range of the x-axis.

ylim

vector giving the range of the y-axis.

main

an overall title for the plot: see title.

xlab

a title for the x axis: title.

ylab

a title for the y axis: title.

form

a character string or a formula with the syntax “y~ x+y + x*y”.
If form is a character it has to be one out of the following:

  • “quadratic”

  • “full”

  • “interaction”

  • “linear”

  • “fit”

“fit” takes the formula from the fit in the facDesign object fdo. Quadratic or higher orders should be given as I(Variable^2).
By default form is set as “fit”.

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. By default steps = 25.

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”.

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.

Value

The function contourPlot() returns an invisible list with the following entries:

Note

For an example in context which shows the usage of the function contourPlot() to an object of class facDesign, please read the vignette for the package qualityTools at http://www.r-qualitytools.org/html/Improve.html.

Author(s)

Thomas Roth thomas.roth@tu-berlin.de

See Also

wirePlot
filled.contour
persp
colorRampPalette
http://www.r-qualitytools.org/html/Improve.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#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(2,3))

#I - display linear fit
contourPlot(A,B,y, data = fdo, form = "linear")
#II - display full fit (i.e. effect, interactions and quadratic effects
contourPlot(A,B,y, data = fdo, form = "full")
#III - display a fit specified before
fits(fdo) = lm(y ~ B + I(A^2) , data = fdo)
contourPlot(A,B,y, data = fdo, form = "fit")
#IV - display a fit given directly
contourPlot(A,B,y, data = fdo, form = "y ~ A*B + I(A^2)")
#V - display a fit using a different colorRamp
contourPlot(A,B,y, data = fdo, form = "full", col = 2)
#VI - display a fit using a self defined colorRamp
myColour = colorRampPalette(c("green", "gray","blue"))
contourPlot(A,B,y, data = fdo, form = "full", col = myColour)

Example output

Loading required package: Rsolnp
Loading required package: MASS

Attaching package: 'qualityTools'

The following object is masked from 'package:stats':

    sigma

Warning messages:
1: In `[<-`(`*tmp*`, i, value = <S4 object of class "doeFactor">) :
  implicit list embedding of S4 objects is deprecated
2: In `[<-`(`*tmp*`, i, value = <S4 object of class "doeFactor">) :
  implicit list embedding of S4 objects is deprecated
3: In `[<-`(`*tmp*`, i, value = <S4 object of class "doeFactor">) :
  implicit list embedding of S4 objects is deprecated

qualityTools documentation built on May 2, 2019, 10:21 a.m.