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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 16 00:09:23 CET 2015


Author: ruckdeschel
Date: 2015-01-16 00:09:22 +0100 (Fri, 16 Jan 2015)
New Revision: 804

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/infoPlot.R
   branches/robast-1.0/pkg/RobAStBase/R/qqplot.R
   branches/robast-1.0/pkg/RobAStBase/inst/NEWS
   branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd
   branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd
   branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd
Log:
[RobAStBase] comparePlot, infoPlot, and the plot-Method for ICs gain optional
  pattern substitution (like plot) which can be switched off by 
  argument withSubst


Modified: branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R	2015-01-15 23:09:22 UTC (rev 804)
@@ -11,13 +11,22 @@
              x.vec = NULL, scaleX = FALSE, scaleX.fct, scaleX.inv,
              scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
              scaleN = 9, x.ticks = NULL, y.ticks = NULL,
-             mfColRow = TRUE, to.draw.arg = NULL){
+             mfColRow = TRUE, to.draw.arg = NULL, withSubst = TRUE){
 
         xc <- match.call(call = sys.call(sys.parent(1)))$x
+        xcc <- as.character(deparse(xc))
         dots <- match.call(call = sys.call(sys.parent(1)), 
                        expand.dots = FALSE)$"..."
         dotsLeg <- dotsT <- dotsL <- .makedotsLowLevel(dots)
 
+       .mpresubs <- if(withSubst){
+                     function(inx) 
+                      .presubs(inx, c("%C", "%A", "%D" ),
+                          c(as.character(class(x)[1]), 
+                            as.character(date()), 
+                            xcc))
+                     }else function(inx)inx
+
         if(!is.logical(inner)){
           if(!is.list(inner))
               inner <- as.list(inner)
@@ -169,11 +178,6 @@
         subL <- FALSE
         lineT <- NA
 
-     .mpresubs <- function(inx)
-                    .presubs(inx, c("%C", "%D", "%A"),
-                          c(as.character(class(x)[1]),
-                            as.character(date()),
-                            as.character(deparse(xc))))
 
      if (hasArg(main)){
          mainL <- TRUE
@@ -307,7 +311,7 @@
 
 
             do.call(plot, args=c(list(x=x.vec1, y=y.vec1, type = plty, lty = lty,
-                                      xlab = xlab, ylab = ylab,
+                                      xlab = .mpresubs(xlab), ylab = .mpresubs(ylab),
                                       panel.first = pF[[i]],
                                       panel.last = pL[[i]]), dots))
             .plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv,

Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R	2015-01-15 23:09:22 UTC (rev 804)
@@ -18,7 +18,8 @@
              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){
+             which.lbs = NULL, which.Order  = NULL, return.Order = FALSE,
+             withSubst = TRUE){
 
         .mc <- match.call(call = sys.call(sys.parent(1)))
         .xc<- function(obj) as.character(deparse(.mc[[obj]]))
@@ -170,7 +171,8 @@
 
       lineT <- NA
 
-      .mpresubs <- function(inx)
+      
+      .mpresubs <- if(withSubst){function(inx)
             .presubs(inx, c(paste("%C",1:ncomp,sep=""),
                                      "%D",
                                     paste("%A",1:ncomp,sep="")),
@@ -179,7 +181,7 @@
                     if(is.null(obj3))NULL else as.character(class(obj3)[1]),
                     if(is.null(obj4))NULL else as.character(class(obj4)[1]),
                     as.character(date()),
-                    xc))
+                    xc))} else function(inx)inx
 
         mainL <- FALSE
         if (hasArg(main)){
@@ -393,7 +395,7 @@
             }
 
             do.call(plot, args=c(list(x = resc1$X, y = y0,
-                 type = "n", xlab = xlab, ylab = ylab,
+                 type = "n", xlab = .mpresubs(xlab), ylab = .mpresubs(ylab),
                  lty = lty[1], col = addAlphTrsp2col(col[1],0),
                  lwd = lwd[1]), dotsP, list(panel.last = pL[[i]], panel.first=pF[[i]])))
             if(plty=="p")

Modified: branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R	2015-01-15 23:09:22 UTC (rev 804)
@@ -18,7 +18,8 @@
              lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
              which.lbs = NULL, which.Order  = NULL, return.Order = FALSE,
              ylab.abs = "absolute information", 
-             ylab.rel= "relative information"){
+             ylab.rel= "relative information",
+             withSubst = TRUE){
 
         objectc <- match.call(call = sys.call(sys.parent(1)))$object
         dots <- match.call(call = sys.call(sys.parent(1)), 
@@ -164,11 +165,12 @@
             subL <- FALSE
             lineT <- NA
        
-           .mpresubs <- function(inx)
+           .mpresubs <- if(withSubst){function(inx)
                     .presubs(inx, c("%C", "%D", "%A"),
                           c(as.character(class(object)[1]),
                             as.character(date()),
                             as.character(deparse(objectc))))
+                    } else function(inx)inx
            
             if (hasArg(main)){
                  mainL <- TRUE
@@ -504,7 +506,7 @@
 
                do.call(plot, args=c(list(resc.C$X, resc.C$Y, type = plty,
                    lty = ltyI, col = colI, lwd = lwdI,
-                   xlab = xlab, ylab = ylab.abs, panel.last = pL.abs,
+                   xlab = .mpresubs(xlab), ylab = .mpresubs(ylab.abs), panel.last = pL.abs,
                    panel.first = pF.abs),
                    dotsP1))
                do.call(lines, args=c(list(resc$X, resc$Y, type = plty,
@@ -568,7 +570,7 @@
                     }else{do.call(par,args=parArgsL[[i+in1to.draw]])}
 
                     do.call(plot, args=c(list(resc$X, y.vec1, type = plty,
-                                  lty = lty, xlab = xlab, ylab = ylab.rel,
+                                  lty = lty, xlab = .mpresubs(xlab), ylab = .mpresubs(ylab.rel),
                                   col = col, lwd = lwd, panel.last = pL.rel,
                                   panel.first = pF.rel),  dotsP))
 

Modified: branches/robast-1.0/pkg/RobAStBase/R/qqplot.R
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/R/qqplot.R	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/R/qqplot.R	2015-01-15 23:09:22 UTC (rev 804)
@@ -23,7 +23,8 @@
     n.adj = TRUE){
 
     mc <- match.call(call = sys.call(sys.parent(1)))
-    if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
+    xcc <- as.character(deparse(mc$x))
+    if(missing(xlab)) mc$xlab <- xcc
     if(missing(ylab)) mc$ylab <- as.character(deparse(mc$y))
     mcl <- as.list(mc)[-1]
 

Modified: branches/robast-1.0/pkg/RobAStBase/inst/NEWS
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/inst/NEWS	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/inst/NEWS	2015-01-15 23:09:22 UTC (rev 804)
@@ -15,6 +15,9 @@
 + comparePlot, infoPlot, and the plot-Method for ICs gain an argument
   with.automatic.grid; if TRUE a corresponding grid oriented at tickmarks
   is produced; this also works for rescaled axes
++ comparePlot, infoPlot, and the plot-Method for ICs gain optional
+  pattern substitution (like plot) which can be switched off by 
+  argument withSubst
 + arguments panel.first, panel.last for plot-methods can now be lists
 + 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/man/comparePlot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd	2015-01-15 23:09:22 UTC (rev 804)
@@ -29,7 +29,8 @@
              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)
+             which.lbs = NULL, which.Order  = NULL, return.Order = FALSE,
+             withSubst = TRUE)
 }
 \arguments{
   \item{obj1}{ object of class \code{"InfluenceCurve"} }
@@ -134,6 +135,8 @@
                          vector \code{"dim<dimnr>"}, \code{dimnr} running through 
                          the number of rows of the trafo matrix.
                          }
+  \item{withSubst}{logical; if \code{TRUE} (default) pattern substitution for
+        titles and lables is used; otherwise no substitution is used. }
   \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
@@ -191,7 +194,8 @@
 and a "generated on <data>"-tag in case of \code{sub}.
 Of course, if \code{main} / \code{inner} / \code{sub} are \code{character}, this
 is used for the title; in case of \code{inner} it is then checked whether it
-has correct length. In all title arguments, the following patterns are substituted:
+has correct length. If argument \code{withSubst} is \code{TRUE}, in all title 
+and axis lable arguments, the following patterns are substituted:
 \describe{
 \item{\code{"\%C1"},\code{"\%C2"},[\code{"\%C3"},][\code{"\%C4"}]}{class of argument 
       \code{obj<i>}, i=1,..4}

Modified: branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd	2015-01-15 23:09:22 UTC (rev 804)
@@ -28,7 +28,8 @@
              lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
              which.lbs = NULL, which.Order  = NULL, return.Order = FALSE,
              ylab.abs = "absolute information", 
-             ylab.rel= "relative information")
+             ylab.rel= "relative information",
+             withSubst = TRUE)
 }
 \arguments{
   \item{object}{object of class \code{"InfluenceCurve"} }
@@ -130,6 +131,8 @@
                          vector \code{"dim<dimnr>"}, \code{dimnr} running through 
                          the number of rows of the trafo matrix.
                          }
+  \item{withSubst}{logical; if \code{TRUE} (default) pattern substitution for
+        titles and lables is used; otherwise no substitution is used. }
   \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
@@ -197,7 +200,8 @@
 and a "generated on <data>"-tag in case of \code{sub}.
 Of course, if \code{main} / \code{inner} / \code{sub} are \code{character}, this
 is used for the title; in case of \code{inner} it is then checked whether it
-has correct length. In all title arguments, the following patterns are substituted:
+has correct length. If argument \code{withSubst} is \code{TRUE}, in all title 
+and axis lable arguments, the following patterns are substituted:
 \describe{
 \item{\code{"\%C"}}{class of argument \code{object}}
 \item{\code{"\%A"}}{deparsed argument  \code{object}}

Modified: branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd
===================================================================
--- branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd	2014-12-22 11:31:54 UTC (rev 803)
+++ branches/robast-1.0/pkg/RobAStBase/man/plot-methods.Rd	2015-01-15 23:09:22 UTC (rev 804)
@@ -19,7 +19,8 @@
              x.vec = NULL, scaleX = FALSE, scaleX.fct, scaleX.inv,
              scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
              scaleN = 9, x.ticks = NULL, y.ticks = NULL,
-             mfColRow = TRUE, to.draw.arg = NULL)
+             mfColRow = TRUE, to.draw.arg = NULL,
+             withSubst = TRUE)
 \S4method{plot}{IC,numeric}(x, y, ..., cex.pts = 1,
              col.pts = par("col"), pch.pts = 1, jitter.fac = 1, with.lab = FALSE,
              lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
@@ -120,6 +121,8 @@
                          vector \code{"dim<dimnr>"}, \code{dimnr} running through 
                          the number of rows of the trafo matrix.
                          }
+  \item{withSubst}{logical; if \code{TRUE} (default) pattern substitution for
+      titles and lables is used; otherwise no substitution is used. }
   \item{cex.pts}{size of the points of the second argument plotted}
   \item{col.pts}{color of the points of the second argument plotted}
   \item{pch.pts}{symbol of the points of the second argument plotted}
@@ -169,7 +172,8 @@
 and a "generated on <data>"-tag in case of \code{sub}.
 Of course, if \code{main} / \code{inner} / \code{sub} are \code{character}, this
 is used for the title; in case of \code{inner} it is then checked whether it
-has correct length. In all title arguments, the following patterns are substituted:
+has correct length. If argument \code{withSubst} is \code{TRUE}, in all title 
+and axis lable arguments, the following patterns are substituted:
 \describe{
 \item{\code{"\%C"}}{class of argument \code{object}}
 \item{\code{"\%A"}}{deparsed argument  \code{object}}



More information about the Robast-commits mailing list