Learn R Programming

RobAStBase (version 1.2.6)

internals_for_RobAStBase_ddPlot: Internal / Helper functions of package RobAStBase for ddPlot

Description

This function is an internally used helper function for ddPlot in package RobAStBase.

Usage

.ddPlot.MatNtNtCoCo(data, ..., dist.x = NormType(), dist.y  = NormType(),
cutoff.x = cutoff(norm = dist.x, cutoff.quantile  = cutoff.quantile.x),
cutoff.y = cutoff(norm = dist.y, cutoff.quantile  = cutoff.quantile.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 = 1,col.idn = par("col"),
lty.cutoff,lwd.cutoff,col.cutoff = "red",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 = 10,
jitter.tol = .Machine$double.eps, doplot = TRUE)

Value

a list (returned as invisible()) with items

id.x

the indices of (possibly transformed) data (within subset id.n) beyond the x-cutoff

id.y

the indices of (possibly transformed) data (within subset id.n) beyond the y-cutoff

id.xy

the indices of (possibly transformed) data (within subset id.n) beyond the x-cutoff and the y-cutoff

qtx

the quantiles of the distances of the (possibly transformed) data in x direction

qty

the quantiles of the distances of the (possibly transformed) data in y direction

cutoff.x.v

the cutoff value in x direction

cutoff.y.v

the cutoff value in y direction

Arguments

data

data in matrix form (columns are observations; rows are variable dimensions) at which to produce the ddPlot.

...

further arguments to be passed to plot.default, text, and abline

dist.x

object of class NormType; the distance for the x axis.

dist.y

object of class NormType; the distance for the y axis.

cutoff.x

object of class cutoff; the cutoff information for the x axis (the vertical line discriminating 'good' and 'bad' points).

cutoff.y

object of class cutoff; the cutoff information for the y axis (the horizontal line discriminating 'good' and 'bad' points).

cutoff.quantile.x

numeric; the cutoff quantile for the x axis.

cutoff.quantile.y

numeric; the cutoff quantile for the y axis.

transform.x

function; a transformation to be performed before determining the distances of the x axis.

transform.y

function; a transformation to be performed before determining the distances of the y axis.

id.n

a set of indices (or a corresponding logical vector); to select a subset of the data in argument data.

cex.pts

the corresponding cex argument for plotted points.

lab.pts

a vector of labels for the (unsubsetted) data.

jitter.pts

the corresponding jitter argument for plotted points; may be a vector of length 2 -- for separate factors for x- and y-coordinate.

alpha.trsp

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).

adj

the corresponding argument for text for labelling the outliers.

cex.idn

the corresponding cex argument for text for labelling the outliers.

col.idn

the corresponding col argument for text for labelling the outliers.

lty.cutoff

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.

lwd.cutoff

(vector cast to length 2): the corresponding lwd argument for abline for drawing the cutoff lines.

col.cutoff

(vector cast to length 2): the corresponding col argument for abline for drawing the cutoff lines.

text.abline

vector of logicals (cast to length 2): shall text be added to cutoff lines.

text.abline.x

text to be added to cutoff lines in x direction; if NULL (default) we use ``[pp] %-cutoff = [ff]'' where [pp] is the percentag up to 2 digits and [ff] is the cutoff value up to 2 digits.

text.abline.y

text to be added to cutoff lines in y direction; if NULL (default) we use ``[pp] %-cutoff = [ff]'' where [pp] is the percentag up to 2 digits and [ff] is the cutoff value up to 2 digits.

cex.abline

vector of numerics (cast to length 2): cex-value for added cutoff text.

col.abline

vector of length 2: color for added cutoff text.

font.abline

vector of length 2: font for added cutoff text.

adj.abline

cast to 2 x 2 matrix (by recycling rules): adjustment values for added cutoff text.

text.abline.x.y

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)]).

text.abline.y.x

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)]).

text.abline.x.x

x-coordinate of text to be added to cutoff lines in x direction; if NULL (default) set to 1.05 times the cutoff value.

text.abline.y.y

y-coordinate of text to be added to cutoff lines in y direction; if NULL (default) set to 1.05 times the cutoff value.

text.abline.x.fmt.cx

format string (see gettextf) to format the cutoff value in label in x direction.

text.abline.x.fmt.qx

format string to format cutoff probability in label in x direction.

text.abline.y.fmt.cy

format string to format the cutoff value in label in y direction.

text.abline.y.fmt.qy

format string to format cutoff probability in label in y direction.

jitter.fac

factor for jittering, see jitter;

jitter.tol

threshold for jittering: if distance between points is smaller than jitter.tol, points are considered replicates.

doplot

logical; shall a plot be produced? if FALSE only the return values are produced.

Author

Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de

Details

performs the plotting for ddPlot and outlyingPlotIC; all arguments except for data are optional. In case they are missing default values are used as usual; for those arguments without default arguments, we do

transform.x

defaults to identity, internally

.
id.n

defaults to 1:ncol(data), internally

.
lab.pts

defaults to (1:ncol(data))[id.n], internally

.
lwd.cutoff

defaults to argument lwd, if given, else to par{lwd}, internally

.
lty.cutoff

defaults to argument lty, if given, else to par{lty}, internally

.

See Also

plot.default, par, ddPlot, outlyingPlotIC

Examples

Run this code
MX <- matrix(rnorm(1500),nrow=6)
QM <- matrix(rnorm(36),nrow=6); QM <- QM %*% t(QM)
RobAStBase:::.ddPlot.MatNtNtCoCo(data=MX, 
        dist.y=QFNorm(QuadF=PosSemDefSymmMatrix(QM)),
        xlab="Norm.x",ylab="Norm.y", cex.idn = 1.3, offset=0,
        lwd=2, lwd.cutoff=4, lty=2, col.cutoff =2, col.idn="green",
        col = "blue", adj=0.4, pos=4,id.n = sample(1:200,size=100),
        lab.pts=letters,log="x", main="GA", sub="NO",cex.sub=0.2)

Run the code above in your browser using DataLab