[Distr-commits] r1220 - branches/distr-2.8/pkg/distrMod branches/distr-2.8/pkg/distrMod/R branches/distr-2.8/pkg/distrMod/man pkg/distrMod pkg/distrMod/R pkg/distrMod/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 26 00:45:13 CEST 2018


Author: ruckdeschel
Date: 2018-07-26 00:45:12 +0200 (Thu, 26 Jul 2018)
New Revision: 1220

Modified:
   branches/distr-2.8/pkg/distrMod/NAMESPACE
   branches/distr-2.8/pkg/distrMod/R/0distrModUtils.R
   branches/distr-2.8/pkg/distrMod/R/qqplot.R
   branches/distr-2.8/pkg/distrMod/R/returnlevelplot.R
   branches/distr-2.8/pkg/distrMod/man/internals-qqplot.Rd
   branches/distr-2.8/pkg/distrMod/man/qqplot.Rd
   branches/distr-2.8/pkg/distrMod/man/returnlevelplot.Rd
   pkg/distrMod/DESCRIPTION
   pkg/distrMod/NAMESPACE
   pkg/distrMod/R/0distrModUtils.R
   pkg/distrMod/R/qqplot.R
   pkg/distrMod/R/returnlevelplot.R
   pkg/distrMod/man/internals-qqplot.Rd
   pkg/distrMod/man/qqplot.Rd
   pkg/distrMod/man/returnlevelplot.Rd
Log:
[distrMod] in trunk and in branch 2.8:
+ qqplot and returnlevelplot have adopted the same argument naming (and selection paradigm) 
  as the other diagnostic plots (IC-plot, comparePlot, infoPlot) in pkg RobAStBase:
    the suffix is .lbs instead of .lbl, 
	the attributes of shown points have ending .pts
	the observations are classed into three groups:
	  - the labelled observations selected through which.lbs and which.Order
	  - the shown non labelled observations (which are not in the previous set)
	    selected by which.nonlbs
	  - the non-shown observations (the remaining ones not contained in the former 2 grps)
	-> point attributes may either refer to prior selection or to post-selection in
       which case we have .npts variants	


Modified: branches/distr-2.8/pkg/distrMod/NAMESPACE
===================================================================
--- branches/distr-2.8/pkg/distrMod/NAMESPACE	2018-07-25 11:40:19 UTC (rev 1219)
+++ branches/distr-2.8/pkg/distrMod/NAMESPACE	2018-07-25 22:45:12 UTC (rev 1220)
@@ -1,5 +1,5 @@
 import("methods")
-importFrom("grDevices", "col2rgb", "dev.new", "rgb")
+importFrom("grDevices", "col2rgb", "dev.new", "rgb", "grey")
 importFrom("graphics", "abline", "legend", "lines", "mtext", "par",
            "points", "text", "title")
 importFrom("stats", "aggregate", "approxfun", "complete.cases",

Modified: branches/distr-2.8/pkg/distrMod/R/0distrModUtils.R
===================================================================
--- branches/distr-2.8/pkg/distrMod/R/0distrModUtils.R	2018-07-25 11:40:19 UTC (rev 1219)
+++ branches/distr-2.8/pkg/distrMod/R/0distrModUtils.R	2018-07-25 22:45:12 UTC (rev 1220)
@@ -590,8 +590,9 @@
     mcl$which.Order <- mcl$order.traf  <- NULL
     mcl$col.pch <- mcl$cex.pch  <- mcl$jit.fac <- NULL
     mcl$col.lbl <- mcl$cex.lbl  <- mcl$adj.lbl <- NULL
-    mcl$exp.cex2.pch <- mcl$exp.cex2.lbl <- NULL
-    mcl$exp.fadcol.pch <- mcl$exp.fadcol.lbl <- NULL
+    mcl$col.lbs <- mcl$cex.lbs  <- mcl$adj.lbs <- NULL
+    mcl$exp.cex2.pch <- mcl$exp.cex2.lbl <- mcl$exp.cex2.lbs <- NULL
+    mcl$exp.fadcol.pch <- mcl$exp.fadcol.lbl <- mcl$exp.fadcol.lbs <- NULL
     mcl$nosym.pCI <- mcl$n.CI <- mcl$n.adj <- NULL
     mcl$legend.cex <- mcl$with.legend <- mcl$legend.bg <- NULL
     mcl$legend.pos <- mcl$legend.pref <- mcl$legend.postf <- NULL
@@ -600,7 +601,8 @@
     mcl$mfColRow <- NULL
     mcl$debug <- NULL
     mcl$added.points.CI <- NULL
-
+    mcl$pch.pts <- mcl$pch.npts <- mcl$cex.pts <- mcl$cex.npts <- NULL
+    mcl$col.pts <- mcl$col.npts <- mcl$which.nonlbs <- mcl$attr.pre <- NULL
 mcl}
 
 ## helpers

Modified: branches/distr-2.8/pkg/distrMod/R/qqplot.R
===================================================================
--- branches/distr-2.8/pkg/distrMod/R/qqplot.R	2018-07-25 11:40:19 UTC (rev 1219)
+++ branches/distr-2.8/pkg/distrMod/R/qqplot.R	2018-07-25 22:45:12 UTC (rev 1220)
@@ -6,7 +6,7 @@
 
 
 ## helper into distrMod
-.labelprep <- function(x,y,lab.pts,col.lbl,cex.lbl,adj.lbl,which.lbs,which.Order,order.traf){
+.labelprep <- function(x,y,lab.pts,col.lbs,cex.lbs,adj.lbs,which.lbs,which.Order,order.traf, which.nonlbs){
       n <- length(x)
       rx <- rank(x)
       xys <- cbind(x,y[rx])
@@ -22,12 +22,15 @@
           oN <- oN0[which.Order]
       x0 <- xys[oN,1]
       y0 <- xys[oN,2]
-      
-      col.lbl <- col.lbl[rx]
+
+      col.lbs <- col.lbs[rx]
       lab.pts <- lab.pts[rx]
-      cex.lbl <- cex.lbl[rx]
-      adj.lbl <- adj.lbl[rx]
-      return(list(x0=x0,y0=y0,lab=lab.pts[oN],col=col.lbl[oN],cex=cex.lbl[oN],adj=adj.lbl[oN]))
+      cex.lbs <- cex.lbs[rx]
+      adj.lbs <- adj.lbs[rx]
+      ind <- 1:n
+      ind.ns <- ind[-oN]
+      if(!is.null(which.nonlbs)) ind.ns <- ind.ns[ind.ns %in% which.nonlbs]
+      return(list(x0=x0,y0=y0,lab=lab.pts[oN],col=col.lbs[oN],cex=cex.lbs[oN],adj=adj.lbs[oN], ord=oN, ns=ind.ns))
 }
 
 
@@ -57,6 +60,8 @@
              lab.pts = NULL,      ## observation labels to be used
              which.lbs = NULL,    ## which observations shall be labelled
              which.Order = NULL,  ## which of the ordered (remaining) observations shall be labelled
+             which.nonlbs = NULL, ## which of the non-labelled observations shall be plotted
+             attr.pre = FALSE,    ## do indices refer to order pre or post ordering
              order.traf = NULL,   ## an optional trafo; by which the observations are ordered (as order(trafo(obs))
              col.IdL = "red",     ## color for the identity line
              lty.IdL = 2,         ## line type for the identity line
@@ -76,11 +81,17 @@
              pch.sCI = par("pch"),## symbol for points (for discrete mass points) in simultaneous CI
              cex.sCI = par("cex"),## magnification factor for points (for discrete mass points) in simultaneous CI
              added.points.CI = TRUE, ## should the CIs be drawn through additional points?
-             cex.pch = par("cex"),## magnification factor for the plotted symbols
-             col.pch = par("col"),## color for the plotted symbols
-             cex.lbl = par("cex"),## magnification factor for the plotted observation labels
-             col.lbl = par("col"),## color for the plotted observation labels
-             adj.lbl = par("adj"),## adj parameter for the plotted observation labels
+             cex.pch = par("cex"),## magnification factor for the plotted symbols (for backward compatibility only, cex.pts in the sequel)
+             col.pch = par("col"),## color for the plotted symbols (for backward compatibility only, col.pts in the sequel)
+             cex.pts = 1,         ## magnification factor for labelled shown observations
+             col.pts = par("col"),## color for labelled shown observations
+             pch.pts = 19,        ## symbol for labelled shown observations
+             cex.npts = 1,        ## magnification factor for non-labelled shown observations
+             col.npts = grey(.5), ## color for non-labelled shown observations
+             pch.npts = 20,       ## symbol for non-labelled shown observations
+             cex.lbs = par("cex"),## magnification factor for the plotted observation labels
+             col.lbs = par("col"),## color for the plotted observation labels
+             adj.lbs = par("adj"),## adj parameter for the plotted observation labels
              alpha.trsp = NA,     ## alpha transparency to be added afterwards
              jit.fac = 0,         ## jittering factor used for discrete distributions
              jit.tol = .Machine$double.eps, ## tolerance for jittering: if distance 
@@ -112,8 +123,8 @@
              cex.pCI = cex.pCI, col.sCI = col.sCI, lty.sCI = lty.sCI,
              lwd.sCI = lwd.sCI, pch.sCI = pch.sCI, cex.sCI = cex.sCI,
              added.points.CI = added.points.CI, cex.pch = cex.pch,
-             col.pch = col.pch, cex.lbl = cex.lbl, col.lbl = col.lbl,
-             adj.lbl = adj.lbl, alpha.trsp = alpha.trsp, jit.fac = jit.fac,
+             col.pch = col.pch, cex.lbs = cex.lbs, col.lbs = col.lbs,
+             adj.lbs = adj.lbs, alpha.trsp = alpha.trsp, jit.fac = jit.fac,
              jit.tol = jit.tol, check.NotInSupport = check.NotInSupport,
              col.NotInSupport = col.NotInSupport, with.legend = with.legend,
              legend.bg = legend.bg, legend.pos = legend.pos,
@@ -153,24 +164,64 @@
 
     if("support" %in% names(getSlots(class(y))))
        yc <- sort(jitter(yc, factor=jit.fac))
-
+#-------------------------------------------------------------------------------
     alp.v <- .makeLenAndOrder(alpha.trsp,ord.x)
     alp.t <- function(x,a1) if(is.na(x)) x else addAlphTrsp2col(x,a1)
     alp.f <- if(length(alpha.trsp)==1L && is.na(alpha.trsp))
              function(x,a) x else function(x,a) mapply(x,alp.t,a1=a)
-    cex.pch <- .makeLenAndOrder(cex.pch,ord.x)
-    cex.lbl <- .makeLenAndOrder(cex.lbl,ord.x)
-    adj.lbl <- .makeLenAndOrder(adj.lbl,ord.x)
-    col.pch <- alp.f(.makeLenAndOrder(col.pch,ord.x),alp.v)
-    col.lbl <- alp.f(.makeLenAndOrder(col.lbl,ord.x),alp.v)
+    cex.lbs <- .makeLenAndOrder(cex.lbs,ord.x)
+    adj.lbs <- .makeLenAndOrder(adj.lbs,ord.x)
+    col.lbs <- alp.f(.makeLenAndOrder(col.lbs,ord.x),alp.v)
 
+    lbprep <- .labelprep(x = xj, y = yc.o, lab.pts = lab.pts,
+                         col.lbs = col.lbs, cex.lbs = cex.lbs,
+                         adj.lbs = adj.lbs, which.lbs = which.lbs,
+                         which.Order = which.Order, order.traf = order.traf,
+                         which.nonlbs = which.nonlbs)
+    n.ns <- length(lbprep$ns)
+    n.s <- length(lbprep$ord)
+
+    shown <- c(lbprep$ord,lbprep$ns)
+
+    if(attr.pre){
+       cex.pch <- .makeLenAndOrder(cex.pch,ord.x)
+       col.pch <- alp.f(.makeLenAndOrder(col.pch,ord.x),alp.v)
+       cex.pts <- if(missing(cex.pts)) cex.pch else .makeLenAndOrder(cex.pts,ord.x)
+       col.pts <- if(missing(col.pts)) col.pch else alp.f(.makeLenAndOrder(col.pts,ord.x),alp.v)
+       pch.pts <- .makeLenAndOrder(pch.pts,ord.x)
+       cex.pts <- cex.pts[shown]
+       col.pts <- col.pts[shown]
+       pch.pts <- pch.pts[shown]
+    }else{
+       cex.pch <- rep(cex.pch,length.out=n.s)
+       col.pch <- alp.f(rep(col.pch,length.out=n.s),alp.v)
+       cex.pts <- if(missing(cex.pts)) cex.pch else rep(cex.pts,length.out=n.s)
+       col.pts <- if(missing(col.pts)) col.pch else alp.f(rep(cex.pts,length.out=n.s),alp.v[lbprep$ord])
+       pch.pts <- rep(pch.pts,length.out=n.s)
+       cex.npts <- rep(cex.pts,length.out=n.ns)
+       col.npts <- alp.f(rep(cex.pts,length.out=n.ns),alp.v[lbprep$ns])
+       pch.npts <- rep(pch.pts,length.out=n.ns)
+       col.pts <- c(col.pts,col.npts)
+       cex.pts <- c(cex.pts,cex.npts)
+       pch.pts <- c(pch.pts,pch.npts)
+    }
+    xs <- x[shown]
+    ycs <- yc.o[shown]
+    ordx <- order(xs)
+    xso <- xs[ordx]
+    ycso <- ycs[ordx]
+    cex.pts <- cex.pts[ordx]
+    col.pts <- col.pts[ordx]
+    pch.pts <- pch.pts[ordx]
+#-------------------------------------------------------------------------------
+
     if(withLab){
       if(is.null(lab.pts)) lab.pts <- paste(ord.x)
       else lab.pts <- .makeLenAndOrder(lab.pts,ord.x)
     }
 
     if(check.NotInSupport){
-       xo <- x[ord.x]
+       xo <- xso #x[ord.x]
        nInSupp <- which(xo < q.l(y)(0))
 
        nInSupp <- unique(sort(c(nInSupp,which( xo > q.l(y)(1)))))
@@ -179,26 +230,27 @@
        if("gaps" %in% names(getSlots(class(y))))
           nInSupp <- unique(sort(c(nInSupp,which( .inGaps(xo,gaps(y))))))
        if(length(nInSupp)){
-          col.pch[nInSupp] <- col.NotInSupport
+#          col.pch[nInSupp] <- col.NotInSupport
+          col.pts[nInSupp] <- col.NotInSupport
           if(withLab)
-#             col.lbl[ord.x[nInSupp]] <- col.NotInSupport
-             col.lbl[nInSupp] <- col.NotInSupport
+#             col.lbs[ord.x[nInSupp]] <- col.NotInSupport
+             col.lbs[nInSupp] <- col.NotInSupport
        }
     }
 
-
     if(n!=length(x)) withLab <- FALSE
 
-    if(datax){ 
-      mcl$x <- xj
-      mcl$y <- yc
+    if(datax){
+      mcl$x <- xso#xj
+      mcl$y <- ycso #yc
     }else{
-      mcl$y <- xj
-      mcl$x <- yc
+      mcl$y <- xso# xj
+      mcl$x <- ycso #yc
     }
     mcl <- .deleteItemsMCL(mcl)
-    mcl$cex <- cex.pch
-    mcl$col <- col.pch
+    mcl$pch <- pch.pts
+    mcl$cex <- cex.pts
+    mcl$col <- col.pts
 
     mcl$xlab <- .mpresubs(mcl$xlab)
     mcl$ylab <- .mpresubs(mcl$ylab)
@@ -218,10 +270,8 @@
 
     ret <- do.call(stats::qqplot, args=mcl)
     qq.usr <- par("usr")
-    lbprep <- NULL
+
     if(withLab&& plot.it){
-       lbprep <- .labelprep(xj,yc,lab.pts,
-                            col.lbl,cex.lbl, adj.lbl,which.lbs,which.Order,order.traf)
        xlb0 <- if(datax) lbprep$x0 else lbprep$y0
        ylb0 <- if(datax) lbprep$y0 else lbprep$x0
        text(x = xlb0, y = ylb0, labels = lbprep$lab,

Modified: branches/distr-2.8/pkg/distrMod/R/returnlevelplot.R
===================================================================
--- branches/distr-2.8/pkg/distrMod/R/returnlevelplot.R	2018-07-25 11:40:19 UTC (rev 1219)
+++ branches/distr-2.8/pkg/distrMod/R/returnlevelplot.R	2018-07-25 22:45:12 UTC (rev 1220)
@@ -31,6 +31,8 @@
              lab.pts = NULL,      ## observation labels to be used
              which.lbs = NULL,    ## which observations shall be labelled
              which.Order = NULL,  ## which of the ordered (remaining) observations shall be labelled
+             which.nonlbs = NULL, ## which of the non-labelled observations shall be plotted
+             attr.pre = FALSE,    ## do indices refer to order pre or post ordering
              order.traf = NULL,   ## an optional trafo; by which the observations are ordered (as order(trafo(obs))
              col.IdL = "red",     ## color for the identity line
              lty.IdL = 2,         ## line type for the identity line
@@ -50,11 +52,17 @@
              pch.sCI = par("pch"),## symbol for points (for discrete mass points) in simultaneous CI
              cex.sCI = par("cex"),## magnification factor for points (for discrete mass points) in simultaneous CI
              added.points.CI = TRUE, ## should the CIs be drawn through additional points?
-             cex.pch = par("cex"),## magnification factor for the plotted symbols
-             col.pch = par("col"),## color for the plotted symbols
-             cex.lbl = par("cex"),## magnification factor for the plotted observation labels
-             col.lbl = par("col"),## color for the plotted observation labels
-             adj.lbl = par("adj"),## adj parameter for the plotted observation labels
+             cex.pch = par("cex"),## magnification factor for the plotted symbols (for backward compatibility only, cex.pts in the sequel)
+             col.pch = par("col"),## color for the plotted symbols (for backward compatibility only, col.pts in the sequel)
+             cex.pts = 1,         ## magnification factor for labelled shown observations
+             col.pts = par("col"),## color for labelled shown observations
+             pch.pts = 19,        ## symbol for labelled shown observations
+             cex.npts = 1,        ## magnification factor for non-labelled shown observations
+             col.npts = grey(.5), ## color for non-labelled shown observations
+             pch.npts = 20,       ## symbol for non-labelled shown observations
+             cex.lbs = par("cex"),## magnification factor for the plotted observation labels
+             col.lbs = par("col"),## color for the plotted observation labels
+             adj.lbs = par("adj"),## adj parameter for the plotted observation labels
              alpha.trsp = NA,     ## alpha transparency to be added afterwards
              jit.fac = 0,         ## jittering factor used for discrete distributions
              jit.tol = .Machine$double.eps, ## tolerance for jittering: if distance 
@@ -85,8 +93,8 @@
              cex.pCI = cex.pCI, col.sCI = col.sCI, lty.sCI = lty.sCI,
              lwd.sCI = lwd.sCI, pch.sCI = pch.sCI, cex.sCI = cex.sCI,
              added.points.CI = added.points.CI, cex.pch = cex.pch,
-             col.pch = col.pch, cex.lbl = cex.lbl, col.lbl = col.lbl,
-             adj.lbl = adj.lbl, alpha.trsp = alpha.trsp, jit.fac = jit.fac,
+             col.pch = col.pch, cex.lbs = cex.lbs, col.lbs = col.lbs,
+             adj.lbs = adj.lbs, alpha.trsp = alpha.trsp, jit.fac = jit.fac,
              jit.tol = jit.tol, check.NotInSupport = check.NotInSupport,
              col.NotInSupport = col.NotInSupport, with.legend = with.legend,
              legend.bg = legend.bg, legend.pos = legend.pos,
@@ -134,10 +142,16 @@
        x <- x + thresh0
     }              
 
+    ord0x <- order(x)
+    rank0x <- rank(x)
+
     xj <- sort(x)
     if(any(.isReplicated(x, jit.tol))&&jit.fac>0)
        xj[.isReplicated(x, jit.tol)] <- jitter(x[.isReplicated(x, jit.tol)], factor=jit.fac)
 
+    ord1x <- ord0x[order(xj)]
+    rank1x <- rank(xj)[rank0x]
+
     xj <- sort(xj)
     ord.x <- order(xj)
 
@@ -173,22 +187,65 @@
     if("support" %in% names(getSlots(class(y))))
        ycl <- sort(jitter(ycl, factor=jit.fac))
 
+#-------------------------------------------------------------------------------
     alp.v <- .makeLenAndOrder(alpha.trsp,ord.x)
     alp.t <- function(x,a1) if(is.na(x)) x else addAlphTrsp2col(x,a1)
     alp.f <- if(length(alpha.trsp)==1L && is.na(alpha.trsp))
              function(x,a) x else function(x,a) mapply(x,alp.t,a1=a)
-    cex.pch <- .makeLenAndOrder(cex.pch,ord.x)
-    cex.lbl <- .makeLenAndOrder(cex.lbl,ord.x)
-    col.pch <- alp.f(.makeLenAndOrder(col.pch,ord.x),alp.v)
-    col.lbl <- alp.f(.makeLenAndOrder(col.lbl,ord.x),alp.v)
+    cex.lbs <- .makeLenAndOrder(cex.lbs,ord.x)
+    adj.lbs <- .makeLenAndOrder(adj.lbs,ord.x)
+    col.lbs <- alp.f(.makeLenAndOrder(col.lbs,ord.x),alp.v)
 
+    lbprep <- .labelprep(x = xj, y = yc.o, lab.pts = lab.pts,
+                         col.lbs = col.lbs, cex.lbs = cex.lbs,
+                         adj.lbs = adj.lbs, which.lbs = which.lbs,
+                         which.Order = which.Order, order.traf = order.traf,
+                         which.nonlbs = which.nonlbs)
+
+    n.ns <- length(lbprep$ns)
+    n.s <- length(lbprep$ord)
+
+    shown <- c(lbprep$ord,lbprep$ns)
+
+    if(attr.pre){
+       cex.pch <- .makeLenAndOrder(cex.pch,ord.x)
+       col.pch <- alp.f(.makeLenAndOrder(col.pch,ord.x),alp.v)
+       cex.pts <- if(missing(cex.pts)) cex.pch else .makeLenAndOrder(cex.pts,ord.x)
+       col.pts <- if(missing(col.pts)) col.pch else alp.f(.makeLenAndOrder(col.pts,ord.x),alp.v)
+       pch.pts <- .makeLenAndOrder(pch.pts,ord.x)
+       cex.pts <- cex.pts[shown]
+       col.pts <- col.pts[shown]
+       pch.pts <- pch.pts[shown]
+    }else{
+       cex.pch <- rep(cex.pch,length.out=n.s)
+       col.pch <- alp.f(rep(col.pch,length.out=n.s),alp.v)
+       cex.pts <- if(missing(cex.pts)) cex.pch else rep(cex.pts,length.out=n.s)
+       col.pts <- if(missing(col.pts)) col.pch else alp.f(rep(cex.pts,length.out=n.s),alp.v[lbprep$ord])
+       pch.pts <- rep(pch.pts,length.out=n.s)
+       cex.npts <- rep(cex.pts,length.out=n.ns)
+       col.npts <- alp.f(rep(cex.pts,length.out=n.ns),alp.v[lbprep$ns])
+       pch.npts <- rep(pch.pts,length.out=n.ns)
+       col.pts <- c(col.pts,col.npts)
+       cex.pts <- c(cex.pts,cex.npts)
+       pch.pts <- c(pch.pts,pch.npts)
+    }
+    xs <- x[shown]
+    ycs <- (ycl[rank1x])[shown]
+    ordx <- order(xs)
+    xso <- xs[ordx]
+    ycso <- ycs[ordx]
+    cex.pts <- cex.pts[ordx]
+    col.pts <- col.pts[ordx]
+    pch.pts <- pch.pts[ordx]
+#-------------------------------------------------------------------------------
+
     if(withLab){
       if(is.null(lab.pts)) lab.pts <- paste(ord.x)
       else lab.pts <- .makeLenAndOrder(lab.pts,ord.x)
     }
 
     if(check.NotInSupport){
-       xo <- x[ord.x]
+       xo <- xso #x[ord.x]
        nInSupp <- which(xo < q.l(y)(0))
 
        nInSupp <- unique(sort(c(nInSupp,which( xo > q.l(y)(1)))))
@@ -197,10 +254,11 @@
        if("gaps" %in% names(getSlots(class(y))))
           nInSupp <- unique(sort(c(nInSupp,which( .inGaps(xo,gaps(y))))))
        if(length(nInSupp)){
-          col.pch[nInSupp] <- col.NotInSupport
+#          col.pch[nInSupp] <- col.NotInSupport
+          col.pts[nInSupp] <- col.NotInSupport
           if(withLab)
-#             col.lbl[ord.x[nInSupp]] <- col.NotInSupport
-             col.lbl[nInSupp] <- col.NotInSupport
+#             col.lbs[ord.x[nInSupp]] <- col.NotInSupport
+             col.lbs[nInSupp] <- col.NotInSupport
        }
     }
 
@@ -229,13 +287,15 @@
           mcl$xlab <- xlab
           mcl$ylab <- ylab
           plotInfo$plotArgs <- c(list(x=xallc1, y=yallc1, log="y",type="n"),mcl)
-          plotInfo$pointArgs <- c(list(x=xj, y=ycl), mcl)
+#          plotInfo$pointArgs <- c(list(x=xj, y=ycl), mcl)
+          plotInfo$pointArgs <- c(list(x=xso, y=ycso), mcl)
     #       ret <- do.call(stats::qqplot, args=mcl0, log="y", ylim = c(0.1,1000))
        }else{
           mcl$ylab <- xlab
           mcl$xlab <- ylab
           plotInfo$plotArgs <- c(list(x=yallc1, y=xallc1, log="x",type="n"),mcl)
-          plotInfo$pointArgs <- c(list(x=ycl, y=xj), mcl)
+#          plotInfo$pointArgs <- c(list(x=ycl, y=xj), mcl)
+          plotInfo$pointArgs <- c(list(x=ycso, y=xso), mcl)
        }
        do.call(plot, plotInfo$plotArgs)
        plotInfo$usr <- par("usr")
@@ -243,17 +303,13 @@
     }
 
     if(withLab&& plot.it){
-       lbprep <- .labelprep(x=xj,y=yc.o,lab.pts=lab.pts,
-                            col.lbl=col.lbl,cex.lbl=cex.lbl,
-                            adj.lbl=adj.lbl, which.lbs=which.lbs,
-                            which.Order=which.Order,order.traf=order.traf)
        lbprep$y0 <- p2rl(lbprep$y0)
        xlb0 <- if(datax) lbprep$x0 else lbprep$y0
        ylb0 <- if(datax) lbprep$y0 else lbprep$x0
        plotInfo$textArgs <- list(x = xlb0, y = ylb0, labels = lbprep$lab,
-            cex = lbprep$cex, col = lbprep$col, adj = adj.lbl)
+            cex = lbprep$cex, col = lbprep$col, adj = adj.lbs)
        text(x = xlb0, y = ylb0, labels = lbprep$lab,
-            cex = lbprep$cex, col = lbprep$col, adj = adj.lbl)
+            cex = lbprep$cex, col = lbprep$col, adj = adj.lbs)
     }
 
     if(withIdLine){

Modified: branches/distr-2.8/pkg/distrMod/man/internals-qqplot.Rd
===================================================================
--- branches/distr-2.8/pkg/distrMod/man/internals-qqplot.Rd	2018-07-25 11:40:19 UTC (rev 1219)
+++ branches/distr-2.8/pkg/distrMod/man/internals-qqplot.Rd	2018-07-25 22:45:12 UTC (rev 1220)
@@ -9,20 +9,25 @@
 These functions are used internally by qqplot of package distrMod.}
 
 \usage{
-.labelprep(x,y,lab.pts,col.lbl,cex.lbl,adj.lbl,which.lbs,which.Order,order.traf)
+.labelprep(x,y,lab.pts,col.lbs,cex.lbs,adj.lbs,which.lbs,
+           which.Order,order.traf, which.nonlbs)
 }
 
 
 \arguments{
 \item{x}{a (numeric) vector}
 \item{y}{a (numeric) vector of same length as \code{x}}
-\item{cex.lbl}{magnification factor for the plotted observation labels}
-\item{col.lbl}{color for the plotted observation labels}
-\item{adj.lbl}{adjustment factor for the plotted observation labels}
+\item{cex.lbs}{magnification factor for the plotted observation labels}
+\item{col.lbs}{color for the plotted observation labels}
+\item{adj.lbs}{adjustment factor for the plotted observation labels}
 \item{lab.pts}{character or \code{NULL}; observation labels to be used}
 \item{which.lbs}{integer or \code{NULL}; which observations shall be labelled}
 \item{which.Order}{integer or \code{NULL}; which of the ordered (remaining) observations shall be labelled}
 \item{order.traf}{function or \code{NULL}; an optional trafo by which the observations are ordered (as order(trafo(obs)).}
+\item{which.nonlbs}{indices of the observations which should be plotted but
+       not labelled; either an integer vector with the indices of the observations
+          to be plotted into graph or \code{NULL} --- then all non-labelled
+          observations are plotted.}
 }
 
 \details{
@@ -44,7 +49,9 @@
 \code{y0} (the thinned out and ordered vector \code{y}),
 \code{lab} (the thinned out and ordered vector of labels \code{lab.pts}),
 \code{col} (the thinned out and ordered vector of colors \code{col.lbs}),
-\code{cex} (the thinned out and ordered vector of magnification factors \code{cex.lbs}).
+\code{cex} (the thinned out and ordered vector of magnification factors \code{cex.lbs}),
+\code{ord} (the (ordered according to y) indices of the observations selected for labelling),
+\code{ns} (the (ordered) indices of the selected non-labelled observations).
 }
 }
 

Modified: branches/distr-2.8/pkg/distrMod/man/qqplot.Rd
===================================================================
--- branches/distr-2.8/pkg/distrMod/man/qqplot.Rd	2018-07-25 11:40:19 UTC (rev 1219)
+++ branches/distr-2.8/pkg/distrMod/man/qqplot.Rd	2018-07-25 22:45:12 UTC (rev 1220)
@@ -10,7 +10,7 @@
     ylab = deparse(substitute(y)),
     ..., width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
     mfColRow = TRUE, n.CI = n, withLab = FALSE, lab.pts = NULL, which.lbs = NULL,
-    which.Order = NULL, order.traf = NULL, 
+    which.Order = NULL, which.nonlbs = NULL, attr.pre = FALSE, order.traf = NULL,
     col.IdL = "red", lty.IdL = 2, lwd.IdL = 2, alpha.CI = .95,
     exact.pCI = (n<100), exact.sCI = (n<100), nosym.pCI = FALSE,
     col.pCI = "orange", lty.pCI = 3, lwd.pCI = 2, pch.pCI = par("pch"),
@@ -18,7 +18,9 @@
     col.sCI = "tomato2", lty.sCI = 4, lwd.sCI = 2, pch.sCI = par("pch"),
     cex.sCI = par("cex"), added.points.CI = TRUE,
     cex.pch = par("cex"), col.pch = par("col"),
-    cex.lbl = par("cex"), col.lbl = par("col"), adj.lbl = par("adj"),
+    cex.pts = 1, col.pts = par("col"), pch.pts = 19,
+    cex.npts = 1, col.npts = grey(.5), pch.npts = 20,
+    cex.lbs = par("cex"), col.lbs = par("col"), adj.lbs = par("adj"),
     alpha.trsp = NA, jit.fac = 0, jit.tol = .Machine$double.eps,
     check.NotInSupport = TRUE, col.NotInSupport = "red",
     with.legend = TRUE, legend.bg = "white",
@@ -66,9 +68,17 @@
 \item{n.CI}{numeric; number of points to be used for confidence interval}
 \item{withLab}{logical; shall observation labels be plotted in?}
 \item{lab.pts}{character or \code{NULL}; observation labels to be used}
+\item{attr.pre}{logical; do graphical attributes for plotted data refer
+                  to indices prior (\code{TRUE}) or posterior to selection
+                  via arguments \code{which.lbs}, \code{which.Order}, \code{which.nonlbs}
+                  (\code{FALSE})? }
 \item{which.lbs}{integer or \code{NULL}; which observations shall be labelled}
 \item{which.Order}{integer or \code{NULL}; which of the ordered (remaining)
 observations shall be labelled}
+\item{which.nonlbs}{indices of the observations which should be plotted but
+        not labelled; either an integer vector with the indices of the observations
+          to be plotted into graph or \code{NULL} --- then all non-labelled
+          observations are plotted.}
 \item{order.traf}{function or \code{NULL}; an optional trafo by which the
 observations are ordered (as order(trafo(obs)).}
 \item{col.IdL}{color for the identity line}
@@ -94,13 +104,35 @@
 simultaneous CI}
 \item{added.points.CI}{logical; should CIs be plotted through additional points
       (and not only through data points)? }
-\item{cex.pch}{magnification factor for the plotted symbols}
-\item{col.pch}{color for the plotted symbols}
-\item{cex.lbl}{magnification factor for the plotted observation labels}
-\item{col.lbl}{color for the plotted observation labels}
-\item{adj.lbl}{adj parameter for the plotted observation labels}
+\item{cex.pch}{magnification factor for the plotted symbols (for backward
+          compatibility); it is ignored once \code{col.pts} is specified.}
+\item{col.pch}{color for the plotted symbols (for backward compatibility); it is
+          ignored once \code{col.pts} is specified.}
+\item{cex.pts}{size of the points of the second argument plotted, can be a vector;
+      if argument \code{attr.pre} is \code{TRUE}, it is recycled to the length
+      of all observations and determines the sizes of all plotted symbols,
+      i.e., the selection is done within this argument; in this case argument
+      \code{col.npts} is ignored. If \code{attr.pre} is \code{FALSE},
+      \code{cex.pts} is recycled to the number of the observations selected
+      for labelling and refers to the index ordering after the
+      selection. Then argument \code{cex.npts} deteremines the sizes
+      of the shown but non-labelled observations as given in argument
+      \code{which.nonlbs}.}
+\item{col.pts}{color of the points of the second argument plotted, can
+         be a vector as in \code{cex.pts} (with \code{col.npts} as counterpart).}
+\item{pch.pts}{symbol of the points of the second argument plotted, can
+         be a vector as in \code{cex.pts} (with \code{pch.npts} as counterpart).}
+\item{col.npts}{color of the non-labelled points of the \code{data} argument
+     plotted; (may be a vector).}
+\item{pch.npts}{symbol of the non-labelled points of the \code{data} argument
+         plotted (may be a vector).}
+\item{cex.npts}{size of the non-labelled points of the \code{data} argument
+                 plotted (may be a vector).}
+\item{cex.lbs}{magnification factor for the plotted observation labels}
+\item{col.lbs}{color for the plotted observation labels}
+\item{adj.lbs}{adj parameter for the plotted observation labels}
 \item{alpha.trsp}{alpha transparency to be added ex post to colors
-        \code{col.pch} and \code{col.lbl}; if one-dim and NA all colors are
+        \code{col.pch} and \code{col.lbs}; if one-dim and NA all colors are
         left unchanged. Otherwise, with usual recycling rules \code{alpha.trsp}
         gets shorted/prolongated to length the data-symbols to be plotted.
         Coordinates of this vector \code{alpha.trsp} with NA are left unchanged,

Modified: branches/distr-2.8/pkg/distrMod/man/returnlevelplot.Rd
===================================================================
--- branches/distr-2.8/pkg/distrMod/man/returnlevelplot.Rd	2018-07-25 11:40:19 UTC (rev 1219)
+++ branches/distr-2.8/pkg/distrMod/man/returnlevelplot.Rd	2018-07-25 22:45:12 UTC (rev 1220)
@@ -13,7 +13,7 @@
     main = "",
     ..., width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
     mfColRow = TRUE, n.CI = n, withLab = FALSE, lab.pts = NULL, which.lbs = NULL,
-    which.Order = NULL, order.traf = NULL, 
+    which.Order = NULL, which.nonlbs = NULL, attr.pre = FALSE, order.traf = NULL,
     col.IdL = "red", lty.IdL = 2, lwd.IdL = 2, alpha.CI = .95,
     exact.pCI = (n<100), exact.sCI = (n<100), nosym.pCI = FALSE,
     col.pCI = "orange", lty.pCI = 3, lwd.pCI = 2, pch.pCI = par("pch"),
@@ -21,7 +21,9 @@
     col.sCI = "tomato2", lty.sCI = 4, lwd.sCI = 2, pch.sCI = par("pch"),
     cex.sCI = par("cex"), added.points.CI = TRUE,
     cex.pch = par("cex"), col.pch = par("col"),
-    cex.lbl = par("cex"), col.lbl = par("col"), adj.lbl = par("adj"),
+    cex.pts = 1, col.pts = par("col"), pch.pts = 19,
+    cex.npts = 1, col.npts = grey(.5), pch.npts = 20,
+    cex.lbs = par("cex"), col.lbs = par("col"), adj.lbs = par("adj"),
     alpha.trsp = NA, jit.fac = 0,  jit.tol = .Machine$double.eps,
     check.NotInSupport = TRUE, col.NotInSupport = "red",
     with.legend = TRUE, legend.bg = "white",
@@ -79,7 +81,15 @@
 \item{n.CI}{numeric; number of points to be used for confidence interval}
 \item{withLab}{logical; shall observation labels be plotted in?}
 \item{lab.pts}{character or \code{NULL}; observation labels to be used}
+\item{attr.pre}{logical; do graphical attributes for plotted data refer
+                  to indices prior (\code{TRUE}) or posterior to selection
+                  via arguments \code{which.lbs}, \code{which.Order}, \code{which.nonlbs}
+                  (\code{FALSE})? }
 \item{which.lbs}{integer or \code{NULL}; which observations shall be labelled}
+\item{which.nonlbs}{indices of the observations which should be plotted but
+        not labelled; either an integer vector with the indices of the observations
+          to be plotted into graph or \code{NULL} --- then all non-labelled
+          observations are plotted.}
 \item{which.Order}{integer or \code{NULL}; which of the ordered (remaining)
 observations shall be labelled}
 \item{order.traf}{function or \code{NULL}; an optional trafo by which the
@@ -107,13 +117,35 @@
 simultaneous CI}
 \item{added.points.CI}{logical; should CIs be plotted through additional points
       (and not only through data points)? }
-\item{cex.pch}{magnification factor for the plotted symbols}
-\item{col.pch}{color for the plotted symbols}
-\item{cex.lbl}{magnification factor for the plotted observation labels}
-\item{col.lbl}{color for the plotted observation labels}
-\item{adj.lbl}{adj parameter for the plotted observation labels}
+\item{cex.pch}{magnification factor for the plotted symbols (for backward
+          compatibility); it is ignored once \code{col.pts} is specified.}
+\item{col.pch}{color for the plotted symbols (for backward compatibility); it is
+          ignored once \code{col.pts} is specified.}
+\item{cex.pts}{size of the points of the second argument plotted, can be a vector;
+      if argument \code{attr.pre} is \code{TRUE}, it is recycled to the length
+      of all observations and determines the sizes of all plotted symbols,
+      i.e., the selection is done within this argument; in this case argument
+      \code{col.npts} is ignored. If \code{attr.pre} is \code{FALSE},
+      \code{cex.pts} is recycled to the number of the observations selected
+      for labelling and refers to the index ordering after the
+      selection. Then argument \code{cex.npts} deteremines the sizes
+      of the shown but non-labelled observations as given in argument
+      \code{which.nonlbs}.}
+\item{col.pts}{color of the points of the second argument plotted, can
+         be a vector as in \code{cex.pts} (with \code{col.npts} as counterpart).}
+\item{pch.pts}{symbol of the points of the second argument plotted, can
+         be a vector as in \code{cex.pts} (with \code{pch.npts} as counterpart).}
+\item{col.npts}{color of the non-labelled points of the \code{data} argument
+     plotted; (may be a vector).}
+\item{pch.npts}{symbol of the non-labelled points of the \code{data} argument
+         plotted (may be a vector).}
+\item{cex.npts}{size of the non-labelled points of the \code{data} argument
+                 plotted (may be a vector).}
+\item{cex.lbs}{magnification factor for the plotted observation labels}
+\item{col.lbs}{color for the plotted observation labels}
+\item{adj.lbs}{adj parameter for the plotted observation labels}
 \item{alpha.trsp}{alpha transparency to be added ex post to colors
-        \code{col.pch} and \code{col.lbl}; if one-dim and NA all colors are
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/distr -r 1220


More information about the Distr-commits mailing list