[Robast-commits] r1273 - pkg/ROptEst/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 6 19:50:59 CET 2024


Author: ruckdeschel
Date: 2024-02-06 19:50:58 +0100 (Tue, 06 Feb 2024)
New Revision: 1273

Modified:
   pkg/ROptEst/R/getMaxIneff.R
Log:
[ROptEst] trunk: in function getMaxIneff() 
          replaced options(warn=-1) which is no longer allowed by a 
          either no suppressed warnings (if arg warn = TRUE)
          or the critical call to getInfRobIC() gets wrapped into suppressWarnings()

Modified: pkg/ROptEst/R/getMaxIneff.R
===================================================================
--- pkg/ROptEst/R/getMaxIneff.R	2024-02-04 12:09:42 UTC (rev 1272)
+++ pkg/ROptEst/R/getMaxIneff.R	2024-02-06 18:50:58 UTC (rev 1273)
@@ -6,9 +6,6 @@
             if(!is(IC,"IC")) 
                stop("Argument IC must be of class 'IC'.")
 
-            ow <- options("warn")
-            on.exit(options(ow))
-
             sb <- .getSB(IC,neighbor)
             si <- sb$s^2
             bi <- sb$b^2
@@ -55,9 +52,10 @@
                         L2derivDistrSymm <- new("DistrSymmList", L2)
                     }
                 }
-                if(!warn) options(warn = -1)
+                suppWarning <- if(!warn) suppressWarnings else function(x) return(x)
 
-                b0 <- getInfRobIC(L2deriv = L2deriv, neighbor = neighbor,
+                b0 <- suppWarning(
+				      getInfRobIC(L2deriv = L2deriv, neighbor = neighbor,
                             risk = risk,  Distr = L2Fam at distribution, 
                             DistrSymm = L2Fam at distrSymm, L2derivSymm = L2derivSymm,
                             L2derivDistrSymm = L2derivDistrSymm, 
@@ -65,6 +63,8 @@
                             maxiter = maxiter, tol = tol, warn = warn, 
                             Finfo = Finfo,
                             verbose = verbose,...)$risk$asBias$value^2
+					  )		
+							
               }else{
                 stop("not yet implemented")
               }



More information about the Robast-commits mailing list