ddPlot-methods: Methods for Function ddPlot in Package 'RobAStBase'

Description Usage Arguments Details Value Author(s) Examples

Description

ddPlot-methods

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ddPlot(data, dist.x, dist.y, cutoff.x, cutoff.y, ...)
## S4 method for signature '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 signature '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 signature '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)

Arguments

data

data coercable to matrix; the data 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 percentage 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 percentage 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.

Details

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

Value

If argument doplot is FALSE: 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

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.

Author(s)

Peter Ruckdeschel [email protected]

Examples

1
2
3
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)))

Example output

Loading required package: rrcov
Loading required package: robustbase
Scalable Robust Estimators with High Breakdown Point (version 1.4-4)

Loading required package: distr
Loading required package: startupmsg
:startupmsg>  Utilities for Start-Up Messages (version 0.9.5)
:startupmsg> 
:startupmsg>  For more information see ?"startupmsg",
:startupmsg>  NEWS("startupmsg")

Loading required package: sfsmisc
:distr>  Object Oriented Implementation of Distributions (version
:distr>  2.7.0)
:distr> 
:distr>  Attention: Arithmetics on distribution objects are
:distr>  understood as operations on corresponding random variables
:distr>  (r.v.s); see distrARITH().
:distr> 
:distr>  Some functions from package 'stats' are intentionally masked
:distr>  ---see distrMASK().
:distr> 
:distr>  Note that global options are controlled by distroptions()
:distr>  ---c.f. ?"distroptions".
:distr> 
:distr>  For more information see ?"distr", NEWS("distr"), as well as
:distr>    http://distr.r-forge.r-project.org/
:distr>  Package "distrDoc" provides a vignette to this package as
:distr>  well as to several extension packages; try
:distr>  vignette("distr").


Attaching package: 'distr'

The following objects are masked from 'package:stats':

    df, qqplot, sd

Loading required package: distrEx
:distrEx>  Extensions of Package 'distr' (version 2.7.0)
:distrEx> 
:distrEx>  Note: Packages "e1071", "moments", "fBasics" should be
:distrEx>  attached /before/ package "distrEx". See
:distrEx>  distrExMASK().Note: Extreme value distribution
:distrEx>  functionality has been moved to
:distrEx> 
:distrEx>        package "RobExtremes". See distrExMOVED().
:distrEx> 
:distrEx>  For more information see ?"distrEx", NEWS("distrEx"), as
:distrEx>  well as
:distrEx>    http://distr.r-forge.r-project.org/
:distrEx>  Package "distrDoc" provides a vignette to this package
:distrEx>  as well as to several related packages; try
:distrEx>  vignette("distr").


Attaching package: 'distrEx'

The following objects are masked from 'package:stats':

    IQR, mad, median, var

Loading required package: distrMod
Loading required package: RandVar
:RandVar>  Implementation of Random Variables (version 1.1.0)
:RandVar> 
:RandVar>  For more information see ?"RandVar", NEWS("RandVar"), as
:RandVar>  well as
:RandVar>    http://robast.r-forge.r-project.org/
:RandVar>  This package also includes a vignette; try
:RandVar>  vignette("RandVar").

Loading required package: MASS
Loading required package: stats4
:distrMod>  Object Oriented Implementation of Probability Models
:distrMod>  (version 2.7.0)
:distrMod> 
:distrMod>  Some functions from pkg's 'base' and 'stats' are
:distrMod>  intentionally masked ---see distrModMASK().
:distrMod> 
:distrMod>  Note that global options are controlled by
:distrMod>  distrModoptions() ---c.f. ?"distrModoptions".
:distrMod> 
:distrMod>  For more information see ?"distrMod",
:distrMod>  NEWS("distrMod"), as well as
:distrMod>    http://distr.r-forge.r-project.org/
:distrMod>  There is a vignette to this package; try
:distrMod>  vignette("distrMod").
:distrMod>  Package "distrDoc" provides a vignette to the other
:distrMod>  distrXXX packages,
:distrMod>  as well as to several related packages; try
:distrMod>  vignette("distr").


Attaching package: 'distrMod'

The following object is masked from 'package:stats4':

    confint

The following object is masked from 'package:stats':

    confint

The following object is masked from 'package:base':

    norm

:RobAStBase>  Robust Asymptotic Statistics (version 1.1.0)
:RobAStBase> 
:RobAStBase>  Some functions from pkg's 'stats' and 'graphics'
:RobAStBase>  are intentionally masked ---see RobAStBaseMASK().
:RobAStBase> 
:RobAStBase>  Note that global options are controlled by
:RobAStBase>  RobAStBaseoptions() ---c.f. ?"RobAStBaseoptions".
:RobAStBase> 
:RobAStBase>  For more information see ?"RobAStBase",
:RobAStBase>  NEWS("RobAStBase"), as well as
:RobAStBase>    http://robast.r-forge.r-project.org/


Attaching package: 'RobAStBase'

The following object is masked from 'package:graphics':

    clip

RobAStBase documentation built on May 2, 2019, 4:14 p.m.