View source: R/3.3_Factorial_designs_Functions.R
contourPlot | R Documentation |
Creates a contour diagram for an object of class facDesign.c
.
contourPlot(
x,
y,
z,
data = NULL,
xlim,
ylim,
main,
xlab,
ylab,
form = "fit",
col = 1,
steps,
fun,
plot = TRUE,
show.scale = TRUE
)
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 |
xlim |
Vector giving the range of the x-axis. |
ylim |
Vector giving the range of the y-axis. |
main |
Character string: title of the plot. |
xlab |
Character string: label for the x-axis. |
ylab |
Character string: label for the y-axis. |
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:
|
col |
A predefined (1, 2, 3 or 4) or self defined colorRampPalette or color to be used (i.e. |
steps |
Number of grid points per factor. By default |
fun |
Function to be applied to z |
plot |
Logical value indicating whether to display the plot. Default is |
show.scale |
Logical value indicating whether to display the color scale on the plot. Default is |
The function contourPlot
returns an invisible list containing:
x - locations of grid lines for x at which the values in z are measured.
y - locations of grid lines for y at which the values in z are measured.
z - a matrix containing the values of z to be plotted.
plot - The generated plot.
wirePlot
, paretoChart
fdo = rsmDesign(k = 3, blocks = 2)
fdo$.response(data.frame(y = rnorm(fdo$nrow())))
#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
fdo$set.fits(fdo$lm(y ~ B + I(A^2)))
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.