[Robast-commits] r776 - in branches/robast-1.0/pkg/RobAStBase: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Aug 5 18:49:40 CEST 2014
Author: ruckdeschel
Date: 2014-08-05 18:49:39 +0200 (Tue, 05 Aug 2014)
New Revision: 776
Modified:
branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R
branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R
branches/robast-1.0/pkg/RobAStBase/R/ddPlot.R
branches/robast-1.0/pkg/RobAStBase/R/ddPlot_utils.R
branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R
branches/robast-1.0/pkg/RobAStBase/R/outlyingPlot.R
branches/robast-1.0/pkg/RobAStBase/R/plotRescaledAxis.R
branches/robast-1.0/pkg/RobAStBase/R/qqplot.R
branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd
branches/robast-1.0/pkg/RobAStBase/man/ddPlot-methods.Rd
branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd
branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd
branches/robast-1.0/pkg/RobAStBase/man/internals_ddPlot.Rd
branches/robast-1.0/pkg/RobAStBase/man/outlyingPlotIC.Rd
branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd
branches/robast-1.0/pkg/RobAStBase/man/qqplot.Rd
Log:
[RobAStBase]
+ bugfix in outlyingnessPlot: for robCov.y ==TRUE (default) the
inverse covariance matrix was used for standardization instead
of the original one
+ .ddPlot.MatNtNtCoCo, and also ddPlot, outlyingnessPlot gain an
additional argument 'doplot' defaulting to TRUE; if FALSE, no plot
is produced and only the return value is calculated.
+ arguments scaleY.fct and scaleY.inv in the plot-method for ICs,
and in comparePlot und infoPlot now also may be lists of functions,
one for each of the panels to be plot; hence scaling of the y-axis
can now be done individually for each panel.
+ in the axis annotation (after rescaling) there are checks now
whether values +-infinity are taken at all. (This was a bug
before for distributions passed on as cdf and quantile function
with finite left or right endpoint.)
+ qqplot-method for c("ANY","InfRobModel") gains argument
'cex.pts.fun' to better control the scaling of points-sizes
Modified: branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -56,6 +56,9 @@
dots$yaxt <- "n"
}
+ scaleY.fct <- .fillList(scaleY.fct, dims0)
+ scaleY.inv <- .fillList(scaleY.inv, dims0)
+
MBRB <- matrix(rep(t(MBRB), length.out=dims0*2),ncol=2, byrow=T)
MBRB <- MBRB * MBR.fac
@@ -251,18 +254,29 @@
fct <- function(x) sapply(x, IC1 at Map[[indi]])
print(xlim[,i])
resc <-.rescalefct(x.vec, fct, scaleX, scaleX.fct,
- scaleX.inv, scaleY, scaleY.fct, xlim[,i],
+ scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i],
ylim[,i], dots)
dots <- resc$dots
dots$xlim <- xlim[,i]
dots$ylim <- ylim[,i]
x.vec1 <- resc$X
y.vec1 <- resc$Y
+
+ finiteEndpoints <- rep(FALSE,4)
+ if(scaleX){
+ finiteEndpoints[1] <- is.finite(scaleX.inv(min(x.vec1, xlim[1,i])))
+ finiteEndpoints[2] <- is.finite(scaleX.inv(max(x.vec1, xlim[2,i])))
+ }
+ if(scaleY){
+ finiteEndpoints[3] <- is.finite(scaleY.inv(min(y.vec1, ylim[1,i])))
+ finiteEndpoints[4] <- is.finite(scaleY.inv(max(y.vec1, ylim[2,i])))
+ }
do.call(plot, args=c(list(x=x.vec1, y=y.vec1, type = plty, lty = lty,
xlab = xlab, ylab = ylab), dots))
.plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv,
- scaleY,scaleY.fct, scaleY.inv,
+ scaleY,scaleY.fct[[i]], scaleY.inv[[i]],
xlim[,i], ylim[,i], x.vec1, ypts = 400, n = scaleN,
+ finiteEndpoints = finiteEndpoints,
x.ticks = x.ticks, y.ticks = y.ticks[[i]])
if(withMBR){
MBR.i <- MBRB[i,]
@@ -272,7 +286,7 @@
if(is(e1, "DiscreteDistribution")){
x.vec1D <- seq(from = min(x.vec), to = max(x.vec), length = 1000)
rescD <-.rescalefct(x.vec1D, fct, scaleX, scaleX.fct,
- scaleX.inv, scaleY, scaleY.fct, xlim[,i],
+ scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i],
ylim[,i], dots)
x.vecD <- rescD$X
y.vecD <- rescD$Y
@@ -341,7 +355,6 @@
dots.without <- dots
dots.without$col <- dots.without$cex <- dots.without$pch <- NULL
-
pL <- expression({})
if(!is.null(dots$panel.last))
pL <- dots$panel.last
@@ -353,7 +366,7 @@
print(xlim[,i])
resc.dat <-.rescalefct(y0s, function(x) sapply(x,ICMap0[[indi]]),
scaleX, scaleX.fct, scaleX.inv,
- scaleY, scaleY.fct, xlim[,i], ylim[,i],
+ scaleY, scaleY.fct[[i]], xlim[,i], ylim[,i],
dwo0)
y1 <- resc.dat$X
ICy <- resc.dat$Y
Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -87,6 +87,9 @@
}
+ scaleY.fct <- .fillList(scaleY.fct, dims0)
+ scaleY.inv <- .fillList(scaleY.inv, dims0)
+
MBRB <- matrix(rep(t(MBRB), length.out=dims0*2),ncol=2, byrow=T)
MBRB <- MBRB * MBR.fac
@@ -288,7 +291,7 @@
pL <- substitute({
doIt <- function(sel.l,fct.l,j.l){
rescd <- .rescalefct(sel.l$data, fct.l, scaleX, scaleX.fct,
- scaleX.inv, scaleY, scaleY.fct, xlim[,i],
+ scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i],
ylim[,i], dotsP)
if(is(distr, "DiscreteDistribution"))
rescd$Y <- jitter(rescd$Y, factor = jitter.fac0[j.l])
@@ -329,7 +332,7 @@
fct1 <- function(x) sapply(x, IC1 at Map[[indi]])
resc.args <- c(list(x.vec, "fc"=fct1, scaleX, scaleX.fct,
- scaleX.inv, scaleY, scaleY.fct, xlim[,i],
+ scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i],
ylim[,i], dotsP))
resc1 <- do.call(.rescalefct, resc.args)
resc.args$fc <- fct2 <- function(x) sapply(x, IC2 at Map[[indi]])
@@ -353,6 +356,17 @@
yM <- max(matp,na.rm=T)
y0 <- matp[,1]
y0[1:2] <- c(ym,yM)
+
+ finiteEndpoints <- rep(FALSE,4)
+ if(scaleX){
+ finiteEndpoints[1] <- is.finite(scaleX.inv(min(x.vec1, xlim[1],na.rm=TRUE)))
+ finiteEndpoints[2] <- is.finite(scaleX.inv(max(x.vec1, xlim[2],na.rm=TRUE)))
+ }
+ if(scaleY){
+ finiteEndpoints[3] <- is.finite(scaleY.inv(min(ym, ylim[1,i],na.rm=TRUE)))
+ finiteEndpoints[4] <- is.finite(scaleY.inv(max(yM, ylim[2,i],na.rm=TRUE)))
+ }
+
do.call(plot, args=c(list(x = resc1$X, y = y0,
type = "n", xlab = xlab, ylab = ylab,
lty = lty[1], col = addAlphTrsp2col(col[1],0),
@@ -364,19 +378,21 @@
do.call(matlines, args = c(list( x = resc1$X, y = matp,
lty = lty, col = col, lwd = lwd), dotsL))
+
.plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv,
- scaleY,scaleY.fct, scaleY.inv, xlim[,i],
+ scaleY,scaleY.fct[[i]], scaleY.inv[[i]], xlim[,i],
ylim[,i], resc1$X, ypts = 400, n = scaleN,
+ finiteEndpoints = finiteEndpoints,
x.ticks = x.ticks, y.ticks = y.ticks[[i]])
if(withMBR){
MBR.i <- MBRB[i,]
- if(scaleY) MBR.i <- scaleY.fct(MBR.i)
+ if(scaleY) MBR.i <- scaleY.fct[[i]](MBR.i)
abline(h=MBR.i, col=col.MBR, lty=lty.MBR, lwd = lwd.MBR)
}
if(is(distr, "DiscreteDistribution")){
rescD.args <- c(list(x.vecD, "fc"=fct1, scaleX, scaleX.fct,
- scaleX.inv, scaleY, scaleY.fct, xlim[,i],
+ scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i],
ylim[,i], dotsP))
resc1D <- do.call(.rescalefct, rescD.args)
rescD.args$fc <- fct2
@@ -404,7 +420,7 @@
if(with.legend){
if(is.null(legend)) legend <- xc
legend(.legendCoord(legend.location, scaleX, scaleX.fct,
- scaleY, scaleY.fct), col = col, bg = legend.bg,
+ scaleY, scaleY.fct[[i]]), col = col, bg = legend.bg,
legend = legend, dotsLeg, cex = legend.cex)
}
Modified: branches/robast-1.0/pkg/RobAStBase/R/ddPlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/ddPlot.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/ddPlot.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -12,7 +12,7 @@
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%%",
- jitt.fac){
+ jitt.fac, doplot = TRUE){
mc <- as.list(match.call(expand.dots = TRUE,
call = sys.call(sys.parent(1)))[-1])
mc$data <- data
@@ -33,7 +33,7 @@
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%%",
- jitt.fac){
+ jitt.fac, doplot = TRUE){
mc <- match.call(call = sys.call(sys.parent(1)))
mc$data <- t(as.matrix(data))
@@ -55,7 +55,7 @@
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%%",
- jitt.fac){
+ jitt.fac, doplot = TRUE){
mc <- match.call(call = sys.call(sys.parent(1)))
mc$data <- matrix(data,nrow=1)
Modified: branches/robast-1.0/pkg/RobAStBase/R/ddPlot_utils.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/ddPlot_utils.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/ddPlot_utils.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -28,7 +28,8 @@
text.abline.x.fmt.qx = "%4.2f%%",
text.abline.y.fmt.cy = "%7.2f",
text.abline.y.fmt.qy = "%4.2f%%",
- jitt.fac = 10){
+ jitt.fac = 10,
+ doplot = TRUE){
dots <- match.call(expand.dots = FALSE)$"..."
@@ -252,34 +253,35 @@
ndata.y0[!isna] <- jitter(ndata.y0[!isna], factor=jitt.pts[2])
pdots$col <- col
- do.call(plot, args = c(list(x = ndata.x0, y=ndata.y0, type = "p"), pdots))
- do.call(box,args=c(adots))
+ if(doplot){
+ do.call(plot, args = c(list(x = ndata.x0, y=ndata.y0, type = "p"), pdots))
+ do.call(box,args=c(adots))
- pusr <- par("usr")
- mid.x <- mean(pusr[c(1,2)])
- mid.y <- mean(pusr[c(3,4)])
- abtdots.y$x <- if(is.null(text.abline.y.x)) mid.x else text.abline.y.x
- abtdots.x$y <- if(is.null(text.abline.x.y)) mid.y else text.abline.x.y
+ pusr <- par("usr")
+ mid.x <- mean(pusr[c(1,2)])
+ mid.y <- mean(pusr[c(3,4)])
+ abtdots.y$x <- if(is.null(text.abline.y.x)) mid.x else text.abline.y.x
+ abtdots.x$y <- if(is.null(text.abline.x.y)) mid.y else text.abline.x.y
- do.call(abline, args = c(list(v=co.x), abdots[[1]]))
- do.call(abline, args = c(list(h=co.y), abdots[[2]]))
+ do.call(abline, args = c(list(v=co.x), abdots[[1]]))
+ do.call(abline, args = c(list(h=co.y), abdots[[2]]))
- if(ab.textL[1])
- do.call(text, args = c(list(y=co.y*1.03), abtdots.y))
+ if(ab.textL[1])
+ do.call(text, args = c(list(y=co.y*1.03), abtdots.y))
# do.call(text, args = c(list(co.x-5,mid.y,paste(cutoff.quantile.y*100,"%-cutoff = ",round(co.x,digits=2)),srt=90)))
- if(ab.textL[2])
- do.call(text, args = c(list(x=co.x*1.03), abtdots.x,srt=90))
+ if(ab.textL[2])
+ do.call(text, args = c(list(x=co.x*1.03), abtdots.x,srt=90))
# do.call(text, args = c(list(mid.x,co.y+5,paste(cutoff.quantile.x*100," %-cutoff = ",round(co.y,digits=2)))))
- if(length(id.xy))
- do.call(text, args = c(list(jitter(ndata.x[id.xy],factor=jitt.fac),
+ if(length(id.xy))
+ do.call(text, args = c(list(jitter(ndata.x[id.xy],factor=jitt.fac),
jitter(ndata.y[id.xy],factor=jitt.fac),
labels=lab.pts[id.xy]), tdots))
#axis(side=4)
# axis(side=1)
-
- return(list(id.x=id0.x, id.y= id0.y, id.xy = id0.xy,
+ }
+ return(invisible(list(id.x=id0.x, id.y= id0.y, id.xy = id0.xy,
qtx = quantile(ndata.x), qty = quantile(ndata.y),
cutoff.x.v = co.x, cutoff.y.v = co.y
- ))
+ )))
}
Modified: branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -63,6 +63,8 @@
cex.pts.fun <- .fillList(cex.pts.fun, (dims0+in1to.draw)*2)
}
+ scaleY.fct <- .fillList(scaleY.fct, length(to.draw1))
+ scaleY.inv <- .fillList(scaleY.inv, length(to.draw1))
if(!is.null(x.ticks)) dots$xaxt <- "n"
if(!is.null(y.ticks)){
@@ -414,10 +416,10 @@
dotsP0 <- dotsP
resc.rel <- .rescalefct(y0, cbind(y0.vec,ICy0),
scaleX, scaleX.fct, scaleX.inv,
- FALSE, scaleY.fct, dots$xlim, dots$ylim, dotsP0)
+ FALSE, scaleY.fct[[i]], dots$xlim, dots$ylim, dotsP0)
resc.rel.c <- .rescalefct(y0c, cbind(y0c.vec,ICy0c),
scaleX, scaleX.fct, scaleX.inv,
- FALSE, scaleY.fct, dots$xlim, dots$ylim, dotsP0)
+ FALSE, scaleY.fct[[i]], dots$xlim, dots$ylim, dotsP0)
c1fun <- if(is.null(cexfun)) NULL else cexfun[[(i1-1)*2+1]]
c2fun <- if(is.null(cexfun)) NULL else cexfun[[(i1-1)*2+2]]
@@ -471,6 +473,17 @@
scaleY0 <- scaleY & (yaxt0[1]!="n")
x.ticks0 <- if(xaxt0[1]!="n") x.ticks else NULL
y.ticks0 <- if(yaxt0[1]!="n") y.ticks[[1]] else NULL
+
+ finiteEndpoints <- rep(FALSE,4)
+ if(scaleX){
+ finiteEndpoints[1] <- is.finite(scaleX.inv(min(resc.C$X, xlim[1],na.rm=TRUE)))
+ finiteEndpoints[2] <- is.finite(scaleX.inv(max(resc.C$X, xlim[2],na.rm=TRUE)))
+ }
+ if(scaleY){
+ finiteEndpoints[3] <- is.finite(scaleY.inv(min(resc.C$Y, ylim[1,1],na.rm=TRUE)))
+ finiteEndpoints[4] <- is.finite(scaleY.inv(max(resc.C$Y, ylim[2,1],na.rm=TRUE)))
+ }
+
.plotRescaledAxis(scaleX0, scaleX.fct, scaleX.inv,
scaleY0,scaleY.fct, scaleY.inv,
dots$xlim, dots$ylim, resc$X, ypts = 400,
@@ -525,14 +538,27 @@
scaleY0 <- scaleY & (yaxt0[i+in1to.draw]!="n")
x.ticks0 <- if(xaxt0[i+in1to.draw]!="n") x.ticks else NULL
y.ticks0 <- if(yaxt0[i+in1to.draw]!="n") y.ticks[[i+in1to.draw]] else NULL
+
+ finiteEndpoints <- rep(FALSE,4)
+ if(scaleX){
+ finiteEndpoints[1] <- is.finite(scaleX.inv(min(resc$X, xlim[1],na.rm=TRUE)))
+ finiteEndpoints[2] <- is.finite(scaleX.inv(max(resc$X, xlim[2],na.rm=TRUE)))
+ }
+ if(scaleY){
+ finiteEndpoints[3] <- is.finite(scaleY.inv[[i+in1to.draw]](min(yvec1, ylim[1,i+in1to.draw],na.rm=TRUE)))
+ finiteEndpoints[4] <- is.finite(scaleY.inv[[i+in1to.draw]](max(yvec1, ylim[2,i+in1to.draw],na.rm=TRUE)))
+ }
+
.plotRescaledAxis(scaleX0, scaleX.fct, scaleX.inv,
- FALSE,scaleY.fct, scaleY.inv, dots$xlim,
+ FALSE,scaleY.fct[[i+in1to.draw]],
+ scaleY.inv[[i+in1to.draw]], dots$xlim,
dots$ylim, resc$X, ypts = 400, n = scaleN,
+ finiteEndpoints = finiteEndpoints,
x.ticks = x.ticks0,
y.ticks = y.ticks0, withbox = withbox)
if(with.legend)
legend(.legendCoord(legend.location[[i1]],
- scaleX, scaleX.fct, scaleY, scaleY.fct),
+ scaleX, scaleX.fct, scaleY, scaleY.fct[[i]]),
bg = legend.bg, legend = legend[[i1]],
col = c(colI, col), lwd = c(lwdI, lwd),
lty = c(ltyI, lty), cex = legend.cex*fac.leg)
Modified: branches/robast-1.0/pkg/RobAStBase/R/outlyingPlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/outlyingPlot.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/outlyingPlot.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -24,6 +24,7 @@
tf.x = data,
tf.y = data,
jitt.fac=10,
+ doplot = TRUE,
main = gettext("Outlyingness \n by means of a distance-distance plot")
){
mc <- as.list(match.call(expand.dots = FALSE))[-1]
@@ -48,7 +49,7 @@
dimevIC <- dim(evIC)[1]
devIC <- data.frame(t(evIC[1:dimevIC,,drop=FALSE]))
CMcd <- PosSemDefSymmMatrix(getCov(CovMcd(devIC,alpha=0.5)))
- asVar <- solve(CMcd)
+ asVar <- CMcd
# cat("\n", sep="", gettext("Robust asVar"), ":\n")
# print(asVar)
}
@@ -143,6 +144,7 @@
lwd.cutoff = mc$lwd.cutoff,
col.cutoff = mc$col.cutoff,
jitt.fac = mc$jitt.fac,
+ doplot = doplot,
main = main)))
}
Modified: branches/robast-1.0/pkg/RobAStBase/R/plotRescaledAxis.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/plotRescaledAxis.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/plotRescaledAxis.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -57,6 +57,7 @@
.plotRescaledAxis <- function(scaleX,scaleX.fct, scaleX.inv,
scaleY,scaleY.fct, scaleY.inv,
xlim, ylim, X, ypts = 400, n = 11,
+ finiteEndpoints = rep(FALSE,4),
x.ticks = NULL, y.ticks = NULL, withbox = TRUE){
# plots rescaled axes acc. to logicals scaleX, scaleY
# to this end uses trafos scaleX.fct with inverse scale.inv
@@ -87,8 +88,8 @@
if(i0){ xf <- c(NA,xf); X <- c(0, X)}
if(i1){ xf <- c(xf,NA); X <- c(X, 1)}
axis(1,at=X,labels=xf)
- if(i0) axis(1,at=0,labels=expression(-infinity))
- if(i1) axis(1,at=1,labels=expression(infinity))
+ if(finiteEndpoints[1]&i0) axis(1,at=0,labels=expression(-infinity))
+ if(finiteEndpoints[2]&i1) axis(1,at=1,labels=expression(infinity))
}else{
if(is.null(xlim)){ xlim <- c(-Inf,Inf)}else{
if(is.na(xlim[1])) xlim[1] <- -Inf
@@ -137,8 +138,8 @@
if(i0){ yf <- c(NA,yf); Y <- c(0, Y)}
if(i1){ yf <- c(yf,NA); Y <- c(Y, 1)}
axis(2,at=Y,labels=yf)
- if(i0) axis(2,at=0,labels=expression(-infinity))
- if(i1) axis(2,at=1,labels=expression(infinity))
+ if(finiteEndpoints[3]&i0) axis(2,at=0,labels=expression(-infinity))
+ if(finiteEndpoints[4]&i1) axis(2,at=1,labels=expression(infinity))
}else{
if(is.null(ylim)){ ylim <- c(-Inf,Inf)}else{
if(is.na(ylim[1])) ylim[1] <- -Inf
Modified: branches/robast-1.0/pkg/RobAStBase/R/qqplot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/qqplot.R 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/R/qqplot.R 2014-08-05 16:49:39 UTC (rev 776)
@@ -58,7 +58,7 @@
function(x, y, n = length(x), withIdLine = TRUE, withConf = TRUE,
withConf.pw = withConf, withConf.sim = withConf,
plot.it = TRUE, xlab = deparse(substitute(x)),
- ylab = deparse(substitute(y)), ..., n.adj = TRUE){
+ ylab = deparse(substitute(y)), ..., cex.pts.fun = NULL, n.adj = TRUE){
mc <- match.call(call = sys.call(sys.parent(1)))
if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
@@ -88,7 +88,17 @@
L2Dx <- evalRandVar(L2D,matrix(x))[,,1]
scx <- solve(sqrt(FI),L2Dx)
xD <- fct(distance)(scx)
- x.cex <- 3/(1+log(1+xD))
+ cex.pts <- if(is.null(mcl[["cex.pts"]])){
+ if(is.null(mcl[["cex"]])){
+ par("cex")
+ }else{
+ eval(mcl$cex)}
+ }else{
+ eval(mcl$cex.pts)
+ }
+
+ x.cex <- 3/(1+.cexscale(xD,xD,cex=cex.pts, fun = cex.pts.fun))
+
mcl$cex.pch <- x.cex
return(do.call(getMethod("qqplot", signature(x="ANY", y="ProbFamily")),
Modified: branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -103,10 +103,14 @@
missing, the quantile function of the underlying observation distribution.}
\item{scaleY.fct}{an isotone, vectorized function mapping for each coordinate the
range of the respective coordinate of the IC
- to [0,1]; defaulting to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}.}
+ to [0,1]; defaulting to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)};
+ can also be a list of functions with one list element for each
+ of the panels to be plot. }
\item{scaleY.inv}{an isotone, vectorized function mapping for each coordinate
the range [0,1] into the range of the respective coordinate of the IC;
- defaulting to the quantile function of \eqn{{\cal N}(0,1)}{N(0,1)}.}
+ defaulting to the quantile function of \eqn{{\cal N}(0,1)}{N(0,1)};
+ can also be a list of functions with one list element for each
+ of the panels to be plot. }
\item{scaleN}{integer; defaults to 9; on rescaled axes, number of x
and y ticks if drawn automatically;}
\item{x.ticks}{numeric; defaults to NULL; (then ticks are chosen automatically);
Modified: branches/robast-1.0/pkg/RobAStBase/man/ddPlot-methods.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/ddPlot-methods.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/ddPlot-methods.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -22,7 +22,7 @@
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\%\%",
- jitt.fac)
+ jitt.fac, doplot = TRUE)
\S4method{ddPlot}{numeric}(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
@@ -36,7 +36,7 @@
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\%\%",
- jitt.fac)
+ jitt.fac, doplot = TRUE)
\S4method{ddPlot}{data.frame}(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
@@ -50,7 +50,7 @@
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\%\%",
- jitt.fac)
+ jitt.fac, doplot = TRUE)
}
\arguments{
\item{data}{data coercable to \code{matrix}; the data at which to produce the \code{ddPlot}.}
@@ -120,6 +120,7 @@
\item{text.abline.y.fmt.cy}{format string to format the cutoff value in label in y direction.}
\item{text.abline.y.fmt.qy}{format string to format cutoff probability in label in y direction.}
\item{jitt.fac}{factor for jittering, see \code{jitter};}
+ \item{doplot}{logical; shall a plot be produced? if \code{FALSE} only the return values are produced.}
}
\details{
The \code{matrix}-method calls \code{.ddPlot.MatNtNtCoCo},
@@ -137,7 +138,7 @@
}
}
\value{
-a list with items
+a list (returned as \code{invisible()}) with items
\item{id.x}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff}
\item{id.y}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{y}-cutoff}
\item{id.xy}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff and the \code{y}-cutoff}
Modified: branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -93,13 +93,17 @@
such that for any \code{x} in the domain,
\code{scaleX.inv(scaleX.fct(x))==x}; if \code{scaleX} is \code{TRUE}
and \code{scaleX.inv} is
- missing, the quantile function of the underlying observation distribution.}
+ missing, the quantile function of the underlying observation distribution. }
\item{scaleY.fct}{an isotone, vectorized function mapping the
range of the norm of the IC to [0,1]; defaulting
- to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}.}
+ to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)};
+ can also be a list of functions with one list element for each
+ of the panels to be plot.}
\item{scaleY.inv}{an isotone, vectorized function mapping [0,1] into the range
of the norm of the IC; defaulting to the quantile function
- of \eqn{{\cal N}(0,1)}{N(0,1)}.}
+ of \eqn{{\cal N}(0,1)}{N(0,1)};
+ can also be a list of functions with one list element for each
+ of the panels to be plot.}
\item{scaleN}{integer; defaults to 9; on rescaled axes, number of x
and y ticks if drawn automatically;}
\item{x.ticks}{numeric; defaults to NULL; (then ticks are chosen automatically);
Modified: branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -20,6 +20,7 @@
xlim, ylim, dots)
.plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv, scaleY,scaleY.fct,
scaleY.inv, xlim, ylim, X, ypts = 400, n = 11,
+ finiteEndpoints = rep(FALSE,4),
x.ticks = NULL, y.ticks = NULL, withbox = TRUE)
.legendCoord(x, scaleX, scaleX.fct, scaleY, scaleY.fct)
.SelectOrderData(data, fct, which.lbs, which.Order)
@@ -53,6 +54,8 @@
scale).}
\item{ylim}{numeric vector of length 2: limits of the plotted y region (in original
scale).}
+ \item{finiteEndpoints}{a logical of length 4: are the unscaled \code{xlim[1]},
+ \code{xlim[2]}, \code{ylim[1]}, \code{ylim[2]} finite? }
\item{x.ticks}{numeric: coordinates in original scale of user-given ticks on x-axis.}
\item{y.ticks}{numeric: coordinates in original scale of user-given ticks on y-axis.}
\item{n}{integer: number of default ticks in x and y axis.}
Modified: branches/robast-1.0/pkg/RobAStBase/man/internals_ddPlot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/internals_ddPlot.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/internals_ddPlot.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -23,7 +23,7 @@
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\%\%",
- jitt.fac)
+ jitt.fac, doplot = TRUE)
}
\arguments{
\item{data}{data in \code{matrix} form (columns are observations; rows are variable
@@ -94,6 +94,7 @@
\item{text.abline.y.fmt.cy}{format string to format the cutoff value in label in y direction.}
\item{text.abline.y.fmt.qy}{format string to format cutoff probability in label in y direction.}
\item{jitt.fac}{factor for jittering, see \code{jitter};}
+ \item{doplot}{logical; shall a plot be produced? if \code{FALSE} only the return values are produced.}
}
\details{
@@ -112,7 +113,7 @@
\value{
-a list with items
+a list (returned as \code{invisible()}) with items
\item{id.x}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff}
\item{id.y}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{y}-cutoff}
\item{id.xy}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff and the \code{y}-cutoff}
Modified: branches/robast-1.0/pkg/RobAStBase/man/outlyingPlotIC.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/outlyingPlotIC.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/outlyingPlotIC.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -11,7 +11,7 @@
id.n, cex.pts = 1,lab.pts, jitt.pts = 0, alpha.trsp = NA,
adj, cex.idn, col.idn, lty.cutoff, lwd.cutoff, col.cutoff,
robCov.x = TRUE, robCov.y = TRUE, tf.x = data, tf.y = data,
- jitt.fac = 10,
+ jitt.fac = 10, doplot = TRUE,
main = gettext("Outlyingness \n by means of a distance-distance plot")
)
}
@@ -67,6 +67,7 @@
transformed y-coordinates when applied to the data;
by default identity.}
\item{jitt.fac}{factor for jittering, see \code{\link{jitter}};}
+ \item{doplot}{logical; shall a plot be produced? if \code{FALSE} only the return values are produced.}
\item{main}{the main title.}
}
\details{
@@ -77,7 +78,7 @@
}
\value{
-a list with items
+a list (returned as \code{invisible()}) with items
\item{id.x}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff}
\item{id.y}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{y}-cutoff}
\item{id.xy}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff and the \code{y}-cutoff}
Modified: branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -80,13 +80,17 @@
\item{scaleY}{logical; shall Y-axis be rescaled (by default according to a probit scale)?}
\item{scaleX.fct}{an isotone, vectorized function mapping the domain of the IC
to [0,1]; if \code{scaleX} is \code{TRUE} and \code{scaleX.fct} is
- missing, the cdf of the underlying observation distribution.}
+ missing, the cdf of the underlying observation distribution;
+ can also be a list of functions with one list element for each
+ of the panels to be plot.}
\item{scaleX.inv}{the inverse function to \code{scale.fct}, i.e., an isotone,
vectorized function mapping [0,1] to the domain of the IC
such that for any \code{x} in the domain,
\code{scaleX.inv(scaleX.fct(x))==x}; if \code{scaleX} is \code{TRUE}
and \code{scaleX.inv} is
- missing, the quantile function of the underlying observation distribution.}
+ missing, the quantile function of the underlying observation distribution;
+ can also be a list of functions with one list element for each
+ of the panels to be plot.}
\item{scaleY.fct}{an isotone, vectorized function mapping for each coordinate the
range of the respective coordinate of the IC
to [0,1]; defaulting to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}.}
Modified: branches/robast-1.0/pkg/RobAStBase/man/qqplot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/qqplot.Rd 2014-08-04 11:17:13 UTC (rev 775)
+++ branches/robast-1.0/pkg/RobAStBase/man/qqplot.Rd 2014-08-05 16:49:39 UTC (rev 776)
@@ -13,7 +13,7 @@
n = length(x), withIdLine = TRUE, withConf = TRUE,
withConf.pw = withConf, withConf.sim = withConf,
plot.it = TRUE, xlab = deparse(substitute(x)),
- ylab = deparse(substitute(y)), ..., n.adj = TRUE)
+ ylab = deparse(substitute(y)), ..., cex.pts.fun = NULL, n.adj = TRUE)
\S4method{qqplot}{ANY,kStepEstimate}(x, y,
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/robast -r 776
More information about the Robast-commits
mailing list