Summary Plots by Factors

DESCRIPTION:

Produces plots, such as side by side boxplots, based on each level of the factor.

USAGE:

plot.factor(x, y=NULL, style="box", rotate=<<see below>>,
   boxmeans=F, character=<<see below>>, data=NULL)

REQUIRED ARGUMENTS:

x
either a factor, a design or data frame, or a formula. If a formula, the response must be present in the formula.

OPTIONAL ARGUMENTS:

y
the response vector, if x is a factor, or x is a design or data frame not containing the response (in which case this argument is required). If x is a formula, then a design or data frame may be given here. Or x can be the data frame and y the formula.
style=
character string indicating style of plot. Possible values are "box" (default), "fraction non0", "shaded bar", and "character". The names can be abbreviated (one character is enough). The four styles produce: box-plots; bar-plots of the fraction of observations not equal to 0; shaded bars with each shaded area representing the number of observations having a particular value; characters plotted at the values of y, the characters given by argument character=. Supplying argument character= implies the style.
rotate=
if TRUE, x-axis labels will be rotated. The default is sum(nchar(xalabs))>80.
boxmeans=
TRUE if you want the mean of the boxplots to be indicated. Applicable for style="box" only.
character=
name of factor whose levels will be used as plotting characters.
data=
a data frame containing the data if x was given as a formula.

Graphical parameters may also be supplied as arguments to this function (see ).

SIDE EFFECTS:

Produces a set of plots, one for each factor. Levels of the factor are arranged along the x-axis. Depending on the value of style, a box, bar, shaded bar, or characters will be plotted at each level.

DETAILS:

This function is a method for the generic function for class factor. It can be invoked by calling for an object x of the appropriate class, or directly by calling regardless of the class of the object.

REFERENCES:

A. E. Freeny, A. E. and Landwehr, J. M. (1990), Displays for data from large designed experiments. Computer Science and Statistics: Proceedings of the 22nd Symposium on the Interface. pp 117-126, Springer Verlag.

SEE ALSO:

, , .

EXAMPLES:

# Do box plots of all factors:
plot.factor(catalyst, Yield ~ ., character = catalyst$Temp,
        main="Yield, points identified by levels of Temp")

plot.factor(skips ~ Opening + Mask, data=solder.balance)

# Do character plot of interaction:
attach(solder.balance)
Boards <- interaction(Solder, Mask, Opening)
plot.factor(Boards, skips, character=Panel, rotate=T)
plot.factor(skips ~ Opening + Mask)