Learn R Programming

r6qualitytools (version 1.0.1)

wirePlot3: wirePlot3: function to create a ternary plot (3D wire plot)

Description

This function creates a ternary plot for mixture designs (i.e. object of class mixDesign).

Usage

wirePlot3(
  x,
  y,
  z,
  response,
  data = NULL,
  main,
  xlab,
  ylab,
  zlab,
  form = "linear",
  col = "Rainbow",
  steps,
  plot = TRUE
)

Value

The function wirePlot3 returns an invisible matrix containing the response values as NA's and numerics.

Arguments

x

Factor 1 of the mixDesign object.

y

Factor 2 of the mixDesign object.

z

Factor 3 of the mixDesign object.

response

the response of the mixDesign object.

data

The mixDesign object from which x,y,z and the response are taken.

main

Character string specifying the main title of the plot.

xlab

Character string specifying the label for the x-axis.

ylab

Character string specifying the label for the y-axis.

zlab

Character string specifying the label for the z-axis.

form

A character string or a formula with the syntax `y ~ A + B + C`. If form is a character string, it has to be one of the following:

  • `linear`

  • `quadratic`

How the form influences the output is described in the reference listed below. By default, form is set to `linear`.

col

Character string specifying the color palette to use for the plot (e.g., `Rainbow`, `Jet`, `Earth`, `Electric`). Default is `Rainbow`.

steps

A numeric value specifying the resolution of the plot, i.e., the number of rows for the square matrix, which also represents the number of grid points per factor. By default, steps is set to 25.

plot

Logical value indicating whether to display the plot. Default is TRUE.

See Also

mixDesign.c, mixDesign, contourPlot3.

Examples

Run this code
#Example 1
mdo <- mixDesign(3, 2, center = FALSE, axial = FALSE, randomize = FALSE, replicates = c(1, 1, 2, 3))
elongation <- c(11.0, 12.4, 15.0, 14.8, 16.1, 17.7,
                16.4, 16.6, 8.8, 10.0, 10.0, 9.7,
                11.8, 16.8, 16.0)
mdo$.response(elongation)
wirePlot3(A, B, C, elongation, data = mdo, form = "quadratic")

#Example 2
mdo <- mixDesign(3,2, center = FALSE, axial = FALSE, randomize = FALSE, replicates  = c(1,1,2,3))
mdo$names(c("polyethylene", "polystyrene", "polypropylene"))
mdo$units("percent")
elongation <- c(11.0, 12.4, 15.0, 14.8, 16.1, 17.7,
                16.4, 16.6, 8.8, 10.0, 10.0, 9.7,
                11.8, 16.8, 16.0)
mdo$.response(elongation)
wirePlot3(A, B, C, elongation, data = mdo, form = "linear")
wirePlot3(A, B, C, elongation, data = mdo, form = "quadratic",
           col = "Jet")
wirePlot3(A, B, C, elongation, data = mdo,
           form = "elongation ~ I(A^2) - B:A + I(C^2)",
           col = "Electric")
wirePlot3(A, B, C, elongation, data = mdo, form = "quadratic",
           col = "Earth")

Run the code above in your browser using DataLab