Plot univariate effects of one or more `factor`

s,
typically for a designed experiment as analyzed by `aov()`

.

1 2 3 4 |

`x` |
either a data frame containing the design factors and
optionally the response, or a |

`y` |
the response, if not given in x. |

`fun` |
a function (or name of one) to be applied to each subset. It must return one number for a numeric (vector) input. |

`data` |
data frame containing the variables referenced by |

`...` |
graphical parameters such as |

`ylim` |
range of y values, as in |

`xlab` |
x axis label, see |

`ylab` |
y axis label with a ‘smart’ default. |

`main` |
main title, see |

`ask` |
logical indicating if the user should be asked before a new page is started – in the case of multiple y's. |

`xaxt` |
character giving the type of x axis. |

`axes` |
logical indicating if axes should be drawn. |

`xtick` |
logical indicating if ticks (one per factor) should be drawn on the x axis. |

The supplied function will be called once for each level of each
factor in the design and the plot will show these summary values. The
levels of a particular factor are shown along a vertical line, and the
overall value of `fun()`

for the response is drawn as a
horizontal line.

A big effort was taken to make this closely compatible to the S
version. However, `col`

(and `fg`

) specifications have
different effects.

In S this was a method of the `plot`

generic function for
`design`

objects.

Roberto Frisullo and Martin Maechler

Chambers, J. M. and Hastie, T. J. eds (1992)
*Statistical Models in S*.
Chapman & Hall, London, **the** *white book*, pp. 546–7 (and 163–4).

Freeny, A. E. and Landwehr, J. M. (1990) Displays for data from large designed experiments; Computer Science and Statistics: Proc.\ 22nd Symp\. Interface, 117–126, Springer Verlag.

`interaction.plot`

for a ‘standard graphic’
of designed experiments.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
require(stats)
plot.design(warpbreaks) # automatic for data frame with one numeric var.
Form <- breaks ~ wool + tension
summary(fm1 <- aov(Form, data = warpbreaks))
plot.design( Form, data = warpbreaks, col = 2) # same as above
## More than one y :
utils::str(esoph)
plot.design(esoph) ## two plots; if interactive you are "ask"ed
## or rather, compare mean and median:
op <- par(mfcol = 1:2)
plot.design(ncases/ncontrols ~ ., data = esoph, ylim = c(0, 0.8))
plot.design(ncases/ncontrols ~ ., data = esoph, ylim = c(0, 0.8),
fun = median)
par(op)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.