ddPlot-methods
ddPlot(data, dist.x, dist.y, cutoff.x, cutoff.y, ...)
# S4 method for matrix
ddPlot(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
transform.x, transform.y = transform.x,
id.n, cex.pts = 1,lab.pts, jitter.pts = 0, alpha.trsp = NA, adj =0, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL,
cex.abline = par("cex"), col.abline = col.cutoff,
font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL,
text.abline.y.x = NULL, text.abline.y.y = NULL,
text.abline.x.fmt.cx = "%7.2f", text.abline.x.fmt.qx = "%4.2f%%",
text.abline.y.fmt.cy = "%7.2f", text.abline.y.fmt.qy = "%4.2f%%",
jitter.fac, jitter.tol = .Machine$double.eps,doplot = TRUE)
# S4 method for numeric
ddPlot(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
transform.x, transform.y = transform.x,
id.n, cex.pts = 1,lab.pts, jitter.pts = 0, alpha.trsp = NA, adj =0, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL,
cex.abline = par("cex"), col.abline = col.cutoff,
font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL,
text.abline.y.x = NULL, text.abline.y.y = NULL,
text.abline.x.fmt.cx = "%7.2f", text.abline.x.fmt.qx = "%4.2f%%",
text.abline.y.fmt.cy = "%7.2f", text.abline.y.fmt.qy = "%4.2f%%",
jitter.fac, jitter.tol=.Machine$double.eps, doplot = TRUE)
# S4 method for data.frame
ddPlot(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
transform.x, transform.y = transform.x,
id.n, cex.pts = 1,lab.pts, jitter.pts = 0, alpha.trsp = NA, adj =0, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL,
cex.abline = par("cex"), col.abline = col.cutoff,
font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL,
text.abline.y.x = NULL, text.abline.y.y = NULL,
text.abline.x.fmt.cx = "%7.2f", text.abline.x.fmt.qx = "%4.2f%%",
text.abline.y.fmt.cy = "%7.2f", text.abline.y.fmt.qy = "%4.2f%%",
jitter.fac, jitter.tol=.Machine$double.eps, doplot = TRUE)
If argument doplot
is FALSE
:
A list (returned as invisible()
) with items
the indices of (possibly transformed) data (within subset id.n
) beyond the x
-cutoff
the indices of (possibly transformed) data (within subset id.n
) beyond the y
-cutoff
the indices of (possibly transformed) data (within subset id.n
) beyond the x
-cutoff and the y
-cutoff
the quantiles of the distances of the (possibly transformed) data in x
direction
the quantiles of the distances of the (possibly transformed) data in y
direction
the cutoff value in x
direction
the cutoff value in y
direction
If argument doplot
is TRUE
:
An S3 object of class c("plotInfo","DiagnInfo")
, i.e., a list
containing the information needed to produce the
respective plot, which at a later stage could be used by different
graphic engines (like, e.g. ggplot
) to produce the plot
in a different framework. A more detailed description will follow in
a subsequent version.
One item is retV
which is the return value in case doplot
is FALSE
.
data coercable to matrix
; the data at which to produce the ddPlot
.
further arguments to be passed to plot.default
, text
, and abline
object of class NormType
; the distance for the x
axis.
object of class NormType
; the distance for the y
axis.
object of class cutoff
; the cutoff information for the x
axis
(the vertical line discriminating 'good' and 'bad' points).
object of class cutoff
; the cutoff information for the y
axis
(the horizontal line discriminating 'good' and 'bad' points).
numeric; the cutoff quantile for the x
axis.
numeric; the cutoff quantile for the y
axis.
function; a transformation to be performed before determining the
distances of the x
axis.
function; a transformation to be performed before determining the
distances of the y
axis.
a set of indices (or a corresponding logical vector); to select a subset
of the data in argument data
.
the corresponding cex
argument for plotted points.
a vector of labels for the (unsubsetted) data
.
the corresponding jitter
argument for plotted points;
may be a vector of length 2 -- for separate factors for x- and y-coordinate.
alpha transparency to be added ex post to colors
col.pch
and col.lbl
; if one-dim and NA all colors are
left unchanged. Otherwise, with usual recycling rules alpha.trsp
gets shorted/prolongated to length the data-symbols to be plotted.
Coordinates of this vector alpha.trsp
with NA are left unchanged,
while for the remaining ones, the alpha channel in rgb space is set
to the respective coordinate value of alpha.trsp
. The non-NA
entries must be integers in [0,255] (0 invisible, 255 opaque).
the corresponding argument for text
for
labelling the outliers.
the corresponding cex
argument for
text
for labelling the outliers.
the corresponding col
argument for
text
for labelling the outliers.
the corresponding lty
argument for
abline
for drawing the cutoff lines;
either one lty-value (one value or vector) or a list of length 2
of lty-values.
(vector cast to length 2): the corresponding lwd
argument for
abline
for drawing the cutoff lines.
(vector cast to length 2): the corresponding col
argument for
abline
for drawing the cutoff lines.
vector of logicals (cast to length 2): shall text be added to cutoff lines.
text to be added to cutoff lines in x direction; if NULL
(default) we use ``[pp] %-cutoff = [ff]'' where [pp] is the percentage up to 2 digits
and [ff] is the cutoff value up to 2 digits.
text to be added to cutoff lines in y direction; if NULL
(default) we use ``[pp] %-cutoff = [ff]'' where [pp] is the percentage up to 2 digits
and [ff] is the cutoff value up to 2 digits.
vector of numerics (cast to length 2): cex-value for added cutoff text.
vector of length 2: color for added cutoff text.
vector of length 2: font for added cutoff text.
cast to 2 x 2 matrix (by recycling rules): adjustment values for added cutoff text.
y-coordinate of text to be added to cutoff lines in x direction;
if NULL
(default) set to mid of mean(par("usr")[c(3,4)])
.
x-coordinate of text to be added to cutoff lines in y direction;
if NULL
(default) set to mid of mean(par("usr")[c(1,2)])
.
x-coordinate of text to be added to cutoff lines in x direction;
if NULL
(default) set to 1.05 times the cutoff value.
y-coordinate of text to be added to cutoff lines in y direction;
if NULL
(default) set to 1.05 times the cutoff value.
format string (see gettextf
) to format the cutoff value in label in x direction.
format string to format cutoff probability in label in x direction.
format string to format the cutoff value in label in y direction.
format string to format cutoff probability in label in y direction.
factor for jittering, see jitter
;
threshold for jittering: if distance between points is smaller
than jitter.tol
, points are considered replicates.
logical; shall a plot be produced? if FALSE
only the return values are produced.
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
The matrix
-method calls .ddPlot.MatNtNtCoCo
,
the numeric
- and data.frame
-methods coerce argument data
to matrix
--- the numeric
-method by a call to matrix(data, nrow=1)
,
in the data.frame
-methods by a call to t(as.matrix(data))
.
In arguments text.abline.x
and text.abline.y
the following
patterns are substituted:
"%qx"
cutoff-quantile in x-direction
"%qy"
cutoff-quantile in y-direction
"%cx"
cutoff-value in x-direction
"%cy"
cutoff-value in y-direction
MX <- matrix(rnorm(1500),nrow=6)
QM <- matrix(rnorm(36),nrow=6); QM <- QM %*% t(QM)
ddPlot(data=MX, dist.y=QFNorm(QuadF=PosSemDefSymmMatrix(QM)))
Run the code above in your browser using DataLab