[Robast-commits] r806 - in branches/robast-1.0/pkg/ROptEst: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 16 00:39:40 CET 2015


Author: ruckdeschel
Date: 2015-01-16 00:39:40 +0100 (Fri, 16 Jan 2015)
New Revision: 806

Modified:
   branches/robast-1.0/pkg/ROptEst/R/AllPlot.R
   branches/robast-1.0/pkg/ROptEst/R/cniperCont.R
   branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R
   branches/robast-1.0/pkg/ROptEst/inst/NEWS
   branches/robast-1.0/pkg/ROptEst/man/cniperCont.Rd
Log:
[ROptEst] + cniperPointPlot gains optional pattern substitution (like plot) 
  which can be switched off by argument withSubst


Modified: branches/robast-1.0/pkg/ROptEst/R/AllPlot.R
===================================================================
--- branches/robast-1.0/pkg/ROptEst/R/AllPlot.R	2015-01-15 23:14:24 UTC (rev 805)
+++ branches/robast-1.0/pkg/ROptEst/R/AllPlot.R	2015-01-15 23:39:40 UTC (rev 806)
@@ -10,7 +10,7 @@
              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){
 
         mcl <- match.call(call = sys.call(sys.parent(1)), expand.dots = TRUE)
 

Modified: branches/robast-1.0/pkg/ROptEst/R/cniperCont.R
===================================================================
--- branches/robast-1.0/pkg/ROptEst/R/cniperCont.R	2015-01-15 23:14:24 UTC (rev 805)
+++ branches/robast-1.0/pkg/ROptEst/R/cniperCont.R	2015-01-15 23:39:40 UTC (rev 806)
@@ -118,15 +118,32 @@
                            pch.pts = 19, jitter.fac = 1, with.lab = FALSE,
                            lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
                            which.lbs = NULL, which.Order  = NULL,
-                           return.Order = FALSE){
+                           return.Order = FALSE, withSubst = TRUE){
 
         mcD <- match.call(expand.dots = FALSE)
         dots <- as.list(mcD$"...")
         mc <- match.call(#call = sys.call(sys.parent(1)),
                        expand.dots = TRUE)
         mcl <- as.list(mc[-1])
+        IC1c <- as.character(deparse(IC1))
+        IC2c <- as.character(deparse(IC2))
 
+       .mpresubs <- if(withSubst){
+                     function(inx) 
+                      .presubs(inx, c("%C1", "%A1", "%C2", "%A2", "%D" ),
+                          c(as.character(class(IC1)[1]), 
+                            IC1c,
+                            as.character(class(IC2)[1]), 
+                            IC2c,
+                            as.character(date())
+                            ))
+                     }else function(inx)inx
 
+        if(!is.null(dots$main)) dots$main <- .mpresubs(dots$main)
+        if(!is.null(dots$sub)) dots$sub <- .mpresubs(dots$sub)
+        if(!is.null(dots$xlab)) dots$xlab <- .mpresubs(dots$xlab)
+        if(!is.null(dots$ylab)) dots$ylab <- .mpresubs(dots$ylab)
+
         if(!is(IC1,"IC")) stop ("IC1 must be of class 'IC'")
         if(!is(IC2,"IC")) stop ("IC2 must be of class 'IC'")
         if(!identical(IC1 at CallL2Fam, IC2 at CallL2Fam))
@@ -262,7 +279,7 @@
                            pch.pts = 19, jitter.fac = 1, with.lab = FALSE,
                            lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
                            which.lbs = NULL, which.Order  = NULL,
-                           return.Order = FALSE){
+                           return.Order = FALSE, withSubst = TRUE){
 
         mc0 <- match.call(#call = sys.call(sys.parent(1)),
                        expand.dots = FALSE)
@@ -270,6 +287,21 @@
                        expand.dots = TRUE)
         mcl <- as.list(mc[-1])
         dots <- as.list(mc0$"...")
+        L2Famc <- as.character(deparse(L2Fam))
+
+       .mpresubs <- if(withSubst){
+                     function(inx) 
+                      .presubs(inx, c("%C", "%A", "%D" ),
+                          c(as.character(class(L2Fam)[1]), 
+                            L2Famc,
+                            as.character(date())
+                            ))
+                     }else function(inx)inx
+
+        if(!is.null(dots$main)) dots$main <- .mpresubs(dots$main)
+        if(!is.null(dots$sub)) dots$sub <- .mpresubs(dots$sub)
+        if(!is.null(dots$xlab)) dots$xlab <- .mpresubs(dots$xlab)
+        if(!is.null(dots$ylab)) dots$ylab <- .mpresubs(dots$ylab)
         if(is.null(mcl$risk)) mcl$risk <- asMSE()
 
         robMod <- InfRobModel(center = L2Fam, neighbor = neighbor)
@@ -286,6 +318,7 @@
 
         if(withMaxRisk) mcl$fromCniperPlot <- TRUE
         mcl$withMaxRisk <- NULL
+        mcl$withSubst <- FALSE
         do.call(cniperCont, mcl)
 }
 

Modified: branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R
===================================================================
--- branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R	2015-01-15 23:14:24 UTC (rev 805)
+++ branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R	2015-01-15 23:39:40 UTC (rev 806)
@@ -102,6 +102,7 @@
                    ,xlab=substitute("Dirac point")
                    ,ylab=substitute("Asymptotic Risk difference (classic - robust)")
                    ,bty = substitute("o")
+                   ,withSubst = TRUE
                    ), scaleList)
 #  print(argsList)
   ##parameter for plotting

Modified: branches/robast-1.0/pkg/ROptEst/inst/NEWS
===================================================================
--- branches/robast-1.0/pkg/ROptEst/inst/NEWS	2015-01-15 23:14:24 UTC (rev 805)
+++ branches/robast-1.0/pkg/ROptEst/inst/NEWS	2015-01-15 23:39:40 UTC (rev 806)
@@ -14,6 +14,8 @@
 user-visible CHANGES:
 + title changed to title style / capitalization
 + cniperPointPlot gains capacity to deal with "interpolRisk" - risks
++ cniperPointPlot gains optional pattern substitution (like plot) 
+  which can be switched off by argument withSubst
 
 GENERAL ENHANCEMENTS:
 

Modified: branches/robast-1.0/pkg/ROptEst/man/cniperCont.Rd
===================================================================
--- branches/robast-1.0/pkg/ROptEst/man/cniperCont.Rd	2015-01-15 23:14:24 UTC (rev 805)
+++ branches/robast-1.0/pkg/ROptEst/man/cniperCont.Rd	2015-01-15 23:39:40 UTC (rev 806)
@@ -21,7 +21,7 @@
                pch.pts = 19, jitter.fac = 1, with.lab = FALSE,
                lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
                which.lbs = NULL, which.Order  = NULL,
-               return.Order = FALSE)
+               return.Order = FALSE, withSubst = TRUE)
 
 
 cniperPoint(L2Fam, neighbor, risk, lower, upper)
@@ -37,7 +37,7 @@
                 pch.pts = 19, jitter.fac = 1, with.lab = FALSE,
                 lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
                 which.lbs = NULL, which.Order  = NULL,
-                return.Order = FALSE)
+                return.Order = FALSE, withSubst = TRUE)
 
 }
 \arguments{
@@ -121,6 +121,8 @@
     reduction by argument \code{which.lbs}, and ordering is according to the norm given by
            \code{normtype(object)});
    otherwise we return \code{invisible()} as usual.}
+  \item{withSubst}{logical; if \code{TRUE} (default) pattern substitution for
+      titles and lables is used; otherwise no substitution is used. }
 }
 \details{
   In case of \code{cniperCont} the difference between the risks of two ICs 
@@ -140,6 +142,19 @@
   a list can be used; its first component is then taken for the
   curve, the second one for the balancing line.
 
+  If argument \code{withSubst} is \code{TRUE}, in all title 
+  and axis lable arguments of \code{cniperCont} and \code{cniperPointPlot}, 
+  the following patterns are substituted:
+  \describe{
+  \item{\code{"\%C"}}{class of argument \code{L2Fam} (for  \code{cniperPointPlot})}
+  \item{\code{"\%A"}}{deparsed argument  \code{L2Fam} (for  \code{cniperPointPlot})}
+  \item{\code{"\%C1"}}{class of argument \code{IC1} (for  \code{cniperCont})}
+  \item{\code{"\%A1"}}{deparsed argument  \code{IC1} (for  \code{cniperCont})}
+  \item{\code{"\%C2"}}{class of argument \code{IC2} (for  \code{cniperCont})}
+  \item{\code{"\%A2"}}{deparsed argument  \code{IC2} (for  \code{cniperCont})}
+  \item{\code{"\%D"}}{time/date-string when the plot was generated}
+  }
+
   For more details about cniper contamination and cniper points we refer 
   to Section~3.5 of Kohl et al. (2008) as well as Ruckdeschel (2004) and 
   the Introduction of Kohl (2005).



More information about the Robast-commits mailing list