Create a normal probability plot with different symbols for the values
of another variable. qqnorm2 produces an object of class
qqnorm2, whose plot method produces the plot.
Usage
qqnorm2(y, z, plot.it=TRUE, datax=TRUE, pch=NULL, ...)
## S3 method for class 'qqnorm2'
plot(x, y, ...)
## S3 method for class 'qqnorm2'
lines(x, ...)
## S3 method for class 'qqnorm2'
points(x, ...)
Arguments
y
For qnorm2, y is a numeric vector for which a normal
probability plot is desired.
For plot.qqnorm2, y is ignored; it is included,
because the generic plot function requires it.
z
A variable to indicate different plotting symbols.
plot.it
logical: Should the result be plotted?
datax
The datax argument of qqnorm: If TRUE, the
data are displayed on the horizontal rather than the vertical axis.
(The default value for datax is the opposite of that for
qqnorm.)
x
an object of class qqnorm2.
pch
a named vector of the plotting symbols to be used with names
corresponding to the levels of z.
By default, if z takes levels
FALSE and TRUE (or 0 and 1), pch=c(4, 1) to plot a "x"
for FALSE and "o" for TRUE.
If z assumes integer values between 0 and 255, by default,
the symbols are chosen as described with points.
Otherwise, by default, z is coerced to
character, and the result is plotted.
If pch is provided, it must eitehr have names corresponding
to levels of z, or z must be integers between 1 and
length(pch).
...
Optional arguments.
For plot.qqnorm2, they are passed to plot.
For qqnorm2, they are passed to qqnorm and to
plot.qqnorm2.
Details
For qqnorm2:
1. q2 <- qqnorm(y, datax=datax, ...)
2. q2[["z"]] <- z
3. q2[["pch"]] gets whatever pch decodes to.
4. Silently return(list(x, y, z, pch)), where "x" and "y" are as
returned by qqnorm in step 1 above.
For plot.qqnorm2, plot(x, y, pch=pch[z], ...).
For lines.qqnorm2, lines(x, y, pch=pch[z], ...).
For points.qqnorm2, points(x, y, pch=pch[z], ...).
Value
qqnorm2 returns a list with components, x, y, z, and pch.