[Robast-commits] r757 - in branches/robast-1.0/pkg/RobAStBase: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 24 13:35:32 CEST 2014


Author: ruckdeschel
Date: 2014-07-24 13:35:32 +0200 (Thu, 24 Jul 2014)
New Revision: 757

Modified:
   branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R
   branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R
   branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd
   branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd
Log:
[RobAStBase] infoPlot and comparePlot gain an argument cex.pts.fun to enable individual scaling of the point sizes to be plotted onto each of the plotted curves

Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R	2014-07-22 17:22:06 UTC (rev 756)
+++ branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R	2014-07-24 11:35:32 UTC (rev 757)
@@ -14,7 +14,7 @@
              scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
              scaleN = 9, x.ticks = NULL, y.ticks = NULL,
              mfColRow = TRUE, to.draw.arg = NULL,
-             cex.pts = 1, col.pts = par("col"),
+             cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
              pch.pts = 1, jitter.fac = 1, with.lab = FALSE,
              lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
              which.lbs = NULL, which.Order  = NULL, return.Order = FALSE){
@@ -82,6 +82,11 @@
            dotsP$yaxt <- "n"
         }
 
+        if(!is.null(cex.pts.fun)){
+           cex.pts.fun <- .fillList(list(cex.pts.fun), dims0*ncomp)
+        }
+
+
         MBRB <- matrix(rep(t(MBRB), length.out=dims0*2),ncol=2, byrow=T)
         MBRB <- MBRB * MBR.fac
 
@@ -280,7 +285,10 @@
 
                      col.l <- if(is.na(al0[j.l])) col0[j.l] else
                                  addAlphTrsp2col(col0[j.l], al0[j.l])
-                     cex.l <- .cexscale(sel.l$y,selAlly,cex=cex0[j.l])   ##.cexscale in infoPlot.R
+
+                     cfun <- if(is.null(cexfun)) NULL else cexfun[[(i-1)*ncomp+j.l]]
+
+                     cex.l <- .cexscale(sel.l$y,selAlly,cex=cex0[j.l], fun = cfun)   ##.cexscale in infoPlot.R
                      do.call(points, args=c(list(rescd$X, rescd$Y, cex = cex.l,
                              col = col.l, pch = pch.pts.l), dwo0))
                      if(with.lab0)
@@ -293,7 +301,7 @@
                  pL0
               }, list(pL0 = pL, cex0 = cex.pts, pch0 = pch.pts, col0 = col.pts,
                       jitter.fac0 = jitter.fac, dwo0 = dots.points, al0 = alp.v,
-                      with.lab0 = with.lab, lab0 = lab.pts)
+                      with.lab0 = with.lab, lab0 = lab.pts, cexfun=cex.pts.fun)
             )
         }
 

Modified: branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R	2014-07-22 17:22:06 UTC (rev 756)
+++ branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R	2014-07-24 11:35:32 UTC (rev 757)
@@ -12,7 +12,7 @@
              scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
              scaleN = 9, x.ticks = NULL, y.ticks = NULL,
              mfColRow = TRUE, to.draw.arg = NULL,
-             cex.pts = 1, col.pts = par("col"),
+             cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
              pch.pts = 1, jitter.fac = 1, with.lab = FALSE,
              lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
              which.lbs = NULL, which.Order  = NULL, return.Order = FALSE,
@@ -59,6 +59,11 @@
         ncols <- ceiling(dims0/nrows)
         in1to.draw <- (1%in%to.draw)
 
+        if(!is.null(cex.pts.fun)){
+           cex.pts.fun <- .fillList(list(cex.pts.fun), (dims0+in1to.draw)*2)
+        }
+
+
         if(!is.null(x.ticks)) dots$xaxt <- "n"
         if(!is.null(y.ticks)){
            y.ticks <- .fillList(list(y.ticks), dims0+in1to.draw)
@@ -71,7 +76,7 @@
              if (in1to.draw) legend.location[[1]] <-  "bottomright"
           }else{
              legend.location <- as.list(legend.location)
-             legend.location <- .fillList(legend.location, dims0+in1to.draw   )
+             legend.location <- .fillList(legend.location, dims0+in1to.draw  )
           }
           if(is.null(legend)){
              legend <- vector("list",dims0+in1to.draw)
@@ -357,8 +362,10 @@
                       ICy0cr1 <- jitter(ICy0cr1, factor = jitter.fac0[2])
                    }
 
-                   f1 <- .cexscale(ICy0,ICy0c,cex=cex0[1])
-                   f1c <- .cexscale(ICy0c,ICy0,cex=cex0[2])
+                   c1fun <- if(is.null(cexfun)) NULL else cexfun[[1]]
+                   c2fun <- if(is.null(cexfun)) NULL else cexfun[[2]]
+                   f1 <- .cexscale(ICy0,ICy0c,cex=cex0[1], fun = c1fun)
+                   f1c <- .cexscale(ICy0c,ICy0,cex=cex0[2], fun = c2fun)
 
                    col.pts <- if(!is.na(al0)) sapply(col0,
                               addAlphTrsp2col, alpha=al0) else col0
@@ -377,7 +384,7 @@
                            pch0 = pch.pts, al0 = alp.v[1],
                            col0 = col.pts, with.lab0 = with.lab, n0 = n,
                            lab.pts0 = lab.pts[i.d], lab.pts0C = lab.pts[i.dC],
-                           jitter.fac0 = jitter.fac)
+                           jitter.fac0 = jitter.fac, cexfun = cex.pts.fun)
                            )
 
                pL.rel <- substitute({
@@ -398,9 +405,12 @@
                               scaleX, scaleX.fct, scaleX.inv,
                               FALSE, scaleY.fct, dots$xlim, dots$ylim, dotsP0)
 
-                   f1 <- .cexscale(resc.rel$scy,resc.rel.c$scy,cex=cex0[1])
-                   f1c <- .cexscale(resc.rel.c$scy,resc.rel$scy,cex=cex0[2])
+                   c1fun <- if(is.null(cexfun)) NULL else cexfun[[(i1-1)*2+1]]
+                   c2fun <- if(is.null(cexfun)) NULL else cexfun[[(i1-1)*2+2]]
 
+                   f1 <- .cexscale(resc.rel$scy,resc.rel.c$scy,cex=cex0[1], fun=c1fun)
+                   f1c <- .cexscale(resc.rel.c$scy,resc.rel$scy,cex=cex0[2], fun=c2fun)
+
                    do.pts(resc.rel$X, resc.rel$Y, f1,col.pts[1],pch0[,1])
                    do.pts(resc.rel.c$X, resc.rel.c$Y, f1c,col.pts[2],pch0[,2])
                    if(with.lab0){
@@ -414,7 +424,7 @@
                            cex0 = cex.pts, pch0 = pch.pts, al0 = alp.v,
                            col0 = col.pts, with.lab0 = with.lab,n0 = n,
                            lab.pts0 = lab.pts[i.d], lab.pts0C = lab.pts[i.dC],
-                           jitter.fac0 = jitter.fac
+                           jitter.fac0 = jitter.fac, cexfun = cex.pts.fun
                            ))
             }
 

Modified: branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd	2014-07-22 17:22:06 UTC (rev 756)
+++ branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd	2014-07-24 11:35:32 UTC (rev 757)
@@ -25,7 +25,7 @@
              scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
              scaleN = 9, x.ticks = NULL, y.ticks = NULL,
              mfColRow = TRUE, to.draw.arg = NULL,
-             cex.pts = 1, col.pts = par("col"),
+             cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
              pch.pts = 1, jitter.fac = 1, with.lab = FALSE,
              lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
              which.lbs = NULL, which.Order  = NULL, return.Order = FALSE)
@@ -118,6 +118,14 @@
                          the number of rows of the trafo matrix.
                          }
   \item{cex.pts}{size of the points of the \code{data} argument plotted}
+  \item{cex.pts.fun}{rescaling function for the size of the points to be plotted;
+        either \code{NULL} (default), then \code{log(1+abs(x))} is used for each of
+        the rescalings, or a function which is then used for each of the
+        rescalings, or a list of functions; if it is a function or a list of
+        functions, if necessary it is recylced to length \code{nIC * dim}
+        where \code{nIC} is the number of pICs and \code{dim} is the number of
+        dimensions of the pICs to be plotted; in the index of this list,
+        \code{nIC} is incremented first; then \code{dim}.}
   \item{col.pts}{color of the points of the \code{data} argument plotted}
   \item{pch.pts}{symbol of the points of the \code{data} argument plotted}
   \item{with.lab}{logical; shall labels be plotted to the observations?}

Modified: branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd	2014-07-22 17:22:06 UTC (rev 756)
+++ branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd	2014-07-24 11:35:32 UTC (rev 757)
@@ -22,7 +22,7 @@
              scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
              scaleN = 9, x.ticks = NULL, y.ticks = NULL,
              mfColRow = TRUE, to.draw.arg = NULL,
-             cex.pts = 1, col.pts = par("col"),
+             cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
              pch.pts = 1, jitter.fac = 1, with.lab = FALSE,
              lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
              which.lbs = NULL, which.Order  = NULL, return.Order = FALSE,
@@ -114,6 +114,16 @@
                          the number of rows of the trafo matrix.
                          }
   \item{cex.pts}{size of the points of the \code{data} argument plotted}
+  \item{cex.pts.fun}{rescaling function for the size of the points to be plotted;
+        either \code{NULL} (default), then \code{log(1+abs(x))} is used for each of
+        the rescalings, or a function which is then used for each of the
+        rescalings, or a list of functions; if it is a function or a list of
+        functions, if necessary it is recylced to length \code{2 * dim}
+        (where 2 is for the two pICs plotted, i.e., the classically optimal one and
+        argument \code{IC}, and \code{dim} is the number of
+        dimensions of the pICs to be plotted; in the index of this list,
+        the index for classical vs. \code{IC} is incremented first;
+        then \code{dim}.}
   \item{col.pts}{color of the points of the \code{data} argument plotted}
   \item{pch.pts}{symbol of the points of the \code{data} argument plotted}
   \item{with.lab}{logical; shall labels be plotted to the observations?}



More information about the Robast-commits mailing list