[Distr-commits] r1275 - in branches/distr-2.8/pkg/distr: . R inst man vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 14 13:40:31 CEST 2018


Author: ruckdeschel
Date: 2018-08-14 13:40:31 +0200 (Tue, 14 Aug 2018)
New Revision: 1275

Modified:
   branches/distr-2.8/pkg/distr/NAMESPACE
   branches/distr-2.8/pkg/distr/R/0pre270.R
   branches/distr-2.8/pkg/distr/R/plot-methods.R
   branches/distr-2.8/pkg/distr/inst/NEWS
   branches/distr-2.8/pkg/distr/man/internals.Rd
   branches/distr-2.8/pkg/distr/man/options.Rd
   branches/distr-2.8/pkg/distr/vignettes/newDistributions-knitr.Rnw
Log:
[distr] branch 2.8.0
-clarified that gumbel is now in RobExtremes in vignette newDistributions-knitr.Rnw
-modified devNew(): in interactive mode it now asks the user to shut some devices first when 
 length(dev.list())>20; and in non-interactive mode, when length(dev.list())>20, it shuts 
 the first 15 open devices (except for the first one) first; this is documented now in ?devNew

Modified: branches/distr-2.8/pkg/distr/NAMESPACE
===================================================================
--- branches/distr-2.8/pkg/distr/NAMESPACE	2018-08-11 18:57:40 UTC (rev 1274)
+++ branches/distr-2.8/pkg/distr/NAMESPACE	2018-08-14 11:40:31 UTC (rev 1275)
@@ -1,7 +1,7 @@
 useDynLib(distr, .registration = TRUE, .fixes = "C_")
 import("methods")
 import("stats")
-importFrom("grDevices", "dev.list", "dev.new", "xy.coords")
+importFrom("grDevices", "dev.list", "dev.new", "xy.coords", "dev.off")
 importFrom("graphics", "plot", "abline", "layout", "legend", "lines", "mtext", "par", "points", "title")
 importFrom("MASS", "ginv")
 importFrom("utils", "str")

Modified: branches/distr-2.8/pkg/distr/R/0pre270.R
===================================================================
--- branches/distr-2.8/pkg/distr/R/0pre270.R	2018-08-11 18:57:40 UTC (rev 1274)
+++ branches/distr-2.8/pkg/distr/R/0pre270.R	2018-08-14 11:40:31 UTC (rev 1275)
@@ -6,9 +6,30 @@
     }
 }else{
     devNew <- function(...){
-        if(length(dev.list())>0)
-           if(!is.null(getOption("newDevice"))) 
-               if(getOption("newDevice")) dev.new(...)
+        if(length(dev.list())>0){
+           if(!is.null(getOption("newDevice"))){
+               nrOpen <- length(grDevices::dev.list())
+               if(getOption("newDevice")==TRUE) {
+                  if(interactive()){
+                      while(nrOpen >20){
+                         invisible(readline(prompt=
+                         paste(gettext(
+                         "Too many open graphic devices; please shut some."),
+                         "\n", gettext(
+                         "When you have shut some devices, press [enter] to continue"),
+                         "\n", sep="")))
+                         nrOpen <- length(grDevices::dev.list())
+                      }
+                  }else{
+                      if(nrOpen >20){
+                         while(nrOpen<-length(grDevices::dev.list())>5)
+                             grDevices::dev.off(which=grDevices::dev.list()[2])
+                      }
+                  }
+               }
+               dev.new(...)
+           }
+        }
     }
 }
 options("newDevice"=FALSE)

Modified: branches/distr-2.8/pkg/distr/R/plot-methods.R
===================================================================
--- branches/distr-2.8/pkg/distr/R/plot-methods.R	2018-08-11 18:57:40 UTC (rev 1274)
+++ branches/distr-2.8/pkg/distr/R/plot-methods.R	2018-08-14 11:40:31 UTC (rev 1275)
@@ -870,7 +870,7 @@
         plotInfoList <- vector("list",length(x))
         plotInfoList$call <- mc
         for(i in 1:length(x)){
-            devNew()
+            #devNew()
             plotInfoList[[i]] <- plot(x[[i]],...)
         }
         class(plotInfoList) <- c("plotInfo","DiagnInfo")

Modified: branches/distr-2.8/pkg/distr/inst/NEWS
===================================================================
--- branches/distr-2.8/pkg/distr/inst/NEWS	2018-08-11 18:57:40 UTC (rev 1274)
+++ branches/distr-2.8/pkg/distr/inst/NEWS	2018-08-14 11:40:31 UTC (rev 1275)
@@ -20,7 +20,10 @@
 + liesInSupport gains an argument checkFin; in case of DiscreteDistributions, it tries to use 
   additional information from internal slot .finSupport, and e.g. if there is a lattice.  
 + liesInSupport now also is available for UnivarLebDecDistribution, LatticeDistribution, and UnivarMixingDistribution
-
++ clarified that the Gumbel distribution has been moved to RobExtremes in vignette newDistributions-knitr.Rnw
++ modified devNew(): in interactive mode it now asks the user to shut some devices first when 
+  length(dev.list())>20; and in non-interactive mode, when length(dev.list())>20, it shuts 
+  the first 15 open devices first; this is documented now in ?devNew
 under the hood:
 + DiscreteDistribution(s) gain a logical slot .finSupport to better control whether the 
   "true" support (not the possibly truncated one in slot support) is infinite (more precisely

Modified: branches/distr-2.8/pkg/distr/man/internals.Rd
===================================================================
--- branches/distr-2.8/pkg/distr/man/internals.Rd	2018-08-11 18:57:40 UTC (rev 1274)
+++ branches/distr-2.8/pkg/distr/man/internals.Rd	2018-08-14 11:40:31 UTC (rev 1275)
@@ -404,7 +404,11 @@
 unevaluated, and otherwise the unchanged argument.
 
 \code{devNew} opens a new device. This function is for back compatibility
-with R versions < 2.8.0.
+with R versions < 2.8.0. To control the number of opened devices, when
+\code{length(dev.list())>20}, in interactive mode we ask the user to shut
+some windows until \code{length(dev.list())<=20}; in non-interactive mode
+we shut the first 15 open devices (except for the first one) before opening
+a new one.
 }
 
 

Modified: branches/distr-2.8/pkg/distr/man/options.Rd
===================================================================
--- branches/distr-2.8/pkg/distr/man/options.Rd	2018-08-11 18:57:40 UTC (rev 1274)
+++ branches/distr-2.8/pkg/distr/man/options.Rd	2018-08-14 11:40:31 UTC (rev 1275)
@@ -20,8 +20,8 @@
 \section{Additionally available options in package 'distr'}{
 \describe{
 \item{\code{"newDevice"}}{logical; controls behaviour when generating several plots within
-one function; if \code{TRUE} a call to \code{\link{devNew}} is inserted to hook function
-\code{\link[graphics:frame]{plot.new}}; if \code{FALSE}, we reproduce the usual behaviour 
+one function; if \code{TRUE}, before each call to  call to \code{\link[graphics:frame]{plot.new}},
+a call to \code{\link{devNew}} is inserted; if \code{FALSE}, we reproduce the usual behaviour
 in \pkg{graphics}, i.e.; we do not call \code{\link{devNew}}. Defaults to \code{FALSE}.}
 }
 } 

Modified: branches/distr-2.8/pkg/distr/vignettes/newDistributions-knitr.Rnw
===================================================================
--- branches/distr-2.8/pkg/distr/vignettes/newDistributions-knitr.Rnw	2018-08-11 18:57:40 UTC (rev 1274)
+++ branches/distr-2.8/pkg/distr/vignettes/newDistributions-knitr.Rnw	2018-08-14 11:40:31 UTC (rev 1275)
@@ -617,7 +617,7 @@
 \item {\footnotesize you could have: \file{man/Binom.Rd}
       for the generating function; in the Binomial case, documentation is in
       \file{Binom-class.Rd}; but in case of the Gumbel distribution,
-      in package \pkg{distrEx}, there is such an extra {\tt .Rd} file}
+      in package \pkg{RobExtremes}, there is such an extra {\tt .Rd} file}
 %
 \end{itemize}
 %
@@ -712,7 +712,7 @@
   \item[Comment] In the classes in package \pkg{distr} (historically the ``oldest''
   in the development of this project), we still use \code{initialize} methods;
   this is no longer needed, if you provide generating functions; for this ``more
-  recent'' approach, confer the realization of class \code{Gumbel} in package \pkg{distrEx}.
+  recent'' approach, confer the realization of class \code{Gumbel} in package \pkg{RobExtremes}.
 \end{itemize}
 
 % -------------------------------------------------------------------------------



More information about the Distr-commits mailing list