[Distr-commits] r346 - in pkg: distr/R distr/chm distr/demo distr/man distrEx/demo distrMod/demo distrMod/inst/scripts distrSim/demo distrTEst/demo distrTeach/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 24 14:08:42 CET 2008


Author: ruckdeschel
Date: 2008-11-24 14:08:41 +0100 (Mon, 24 Nov 2008)
New Revision: 346

Modified:
   pkg/distr/R/0distrOptions.R
   pkg/distr/R/0pre270.R
   pkg/distr/R/AllClasses.R
   pkg/distr/R/plot-methods.R
   pkg/distr/R/plot-methods_LebDec.R
   pkg/distr/chm/00Index.html
   pkg/distr/chm/Distr.chm
   pkg/distr/chm/Distr.hhp
   pkg/distr/chm/Distr.toc
   pkg/distr/chm/UnivariateDistribution-class.html
   pkg/distr/demo/ComparisonFFTandRtoDPQ.R
   pkg/distr/demo/ConvolutionNormalDistr.R
   pkg/distr/demo/Expectation.R
   pkg/distr/demo/NormApprox.R
   pkg/distr/demo/StationaryRegressorDistr.R
   pkg/distr/demo/destructive.R
   pkg/distr/demo/nFoldConvolution.R
   pkg/distr/demo/range.R
   pkg/distr/man/UnivariateDistribution-class.Rd
   pkg/distrEx/demo/Prognose.R
   pkg/distrEx/demo/distrExUse.R
   pkg/distrMod/demo/censoredPois.R
   pkg/distrMod/demo/modelExp3.R
   pkg/distrMod/inst/scripts/BetaFam.R
   pkg/distrMod/inst/scripts/PoisFam.R
   pkg/distrMod/inst/scripts/censoredPois.R
   pkg/distrMod/inst/scripts/example_CvMMDE.R
   pkg/distrMod/inst/scripts/examples2.R
   pkg/distrMod/inst/scripts/modelExp3.R
   pkg/distrSim/demo/Simulate.R
   pkg/distrTEst/demo/SimulateandEstimate.R
   pkg/distrTeach/demo/illustCLT.R
   pkg/distrTeach/demo/illustCLT_tcl.R
   pkg/distrTeach/demo/illustLLN.R
Log:
+check if getOption("newDevice")==TRUE; only if so call dev.new()
+fixed an unmatched right brace in UnivariateDistribution-class
+inserted options("newDevice"=TRUE) in demos

Modified: pkg/distr/R/0distrOptions.R
===================================================================
--- pkg/distr/R/0distrOptions.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/R/0distrOptions.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -34,5 +34,6 @@
   invisible(current)
 }
 
-getdistrOption<-function(x)distroptions(x)[[1]]
+getdistrOption <- function(x)distroptions(x)[[1]]
 
+options("newDevice" = FALSE)
\ No newline at end of file

Modified: pkg/distr/R/0pre270.R
===================================================================
--- pkg/distr/R/0pre270.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/R/0pre270.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -7,7 +7,9 @@
 }else{
     devNew <- function(...){
         if(length(dev.list())>0)
-           dev.new(...)
+           if(!is.null(getOption("newDevice"))) 
+               if(getOption("newDevice")) dev.new(...)
     }
 }
+options("newDevice"=FALSE)
 

Modified: pkg/distr/R/AllClasses.R
===================================================================
--- pkg/distr/R/AllClasses.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/R/AllClasses.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -33,7 +33,6 @@
   invisible()
 } 
 
-
 ################################
 ##
 ## Optional..-classes

Modified: pkg/distr/R/plot-methods.R
===================================================================
--- pkg/distr/R/plot-methods.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/R/plot-methods.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -47,8 +47,9 @@
      if (hasArg(col) && missing(col.sub))
         col.sub <- dots$col
 
-     if (!withSweave)
-          devNew(width = width, height = height)
+     if (!withSweave){
+           devNew(width = width, height = height)
+           }
      omar <- par("mar")
      
      mainL <- FALSE
@@ -308,8 +309,9 @@
      if (hasArg(col) && missing(col.sub))
         col.sub <- dots$col
 
-     if (!withSweave)
-         devNew(width = width, height = height)
+     if (!withSweave){
+           devNew(width = width, height = height)
+           }
      omar <- par("mar")
      
      mainL <- FALSE
@@ -532,7 +534,7 @@
 setMethod("plot", signature(x =  "DistrList", y = "missing"),
     function(x,  ...){ 
         for(i in 1:length(x)){
-            devNew()
+            #devNew()
             plot(x[[i]],...)
         }
     })

Modified: pkg/distr/R/plot-methods_LebDec.R
===================================================================
--- pkg/distr/R/plot-methods_LebDec.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/R/plot-methods_LebDec.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -94,8 +94,9 @@
      if (hasArg(col) && missing(col.sub))
         col.sub <- dots$col
 
-     if (!withSweave)
-          devNew(width = width, height = height)
+     if (!withSweave){
+           devNew(width = width, height = height)
+           }
      omar <- par("mar")
 
      mainL <- FALSE

Modified: pkg/distr/chm/00Index.html
===================================================================
--- pkg/distr/chm/00Index.html	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/chm/00Index.html	2008-11-24 13:08:41 UTC (rev 346)
@@ -1090,6 +1090,8 @@
 <td>Methods for Function ncp in Package &lsquo;distr&rsquo; </td></tr>
 <tr><td width="25%"><a href="ncp-methods.html">ncp&lt;--methods</a></td>
 <td>Methods for Function ncp in Package &lsquo;distr&rsquo; </td></tr>
+<tr><td width="25%"><a href="options.html">newDevice</a></td>
+<td>additional options in package &lsquo;distr&rsquo; </td></tr>
 <tr><td width="25%"><a href="Norm-class.html">Norm</a></td>
 <td>Class "Norm"</td></tr>
 <tr><td width="25%"><a href="Norm-class.html">Norm-class</a></td>
@@ -1109,6 +1111,8 @@
 <td>Classes "OptionalParameter", "OptionalMatrix" </td></tr>
 <tr><td width="25%"><a href="OptionalParameter-class.html">OptionalParameter-class</a></td>
 <td>Classes "OptionalParameter", "OptionalMatrix" </td></tr>
+<tr><td width="25%"><a href="options.html">options</a></td>
+<td>additional options in package &lsquo;distr&rsquo; </td></tr>
 </table>
 
 <h2><a name="P">-- P --</a></h2>

Modified: pkg/distr/chm/Distr.chm
===================================================================
(Binary files differ)

Modified: pkg/distr/chm/Distr.hhp
===================================================================
--- pkg/distr/chm/Distr.hhp	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/chm/Distr.hhp	2008-11-24 13:08:41 UTC (rev 346)
@@ -116,6 +116,7 @@
 name-methods.html
 ncp-methods.html
 operators-methods.html
+options.html
 p-methods.html
 p.l-methods.html
 param-methods.html

Modified: pkg/distr/chm/Distr.toc
===================================================================
--- pkg/distr/chm/Distr.toc	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/chm/Distr.toc	2008-11-24 13:08:41 UTC (rev 346)
@@ -2270,6 +2270,10 @@
 <param name="Local" value="ncp-methods.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="newDevice">
+<param name="Local" value="options.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="Norm">
 <param name="Local" value="Norm-class.html">
 </OBJECT>
@@ -2298,6 +2302,10 @@
 <param name="Local" value="OptionalParameter-class.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="options">
+<param name="Local" value="options.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="p">
 <param name="Local" value="p-methods.html">
 </OBJECT>
@@ -3299,6 +3307,10 @@
 </OBJECT>
 <UL>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="additional options in package `distr' ">
+<param name="Local" value="options.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="Arithmetics on Distributions">
 <param name="Local" value="distrARITH.html">
 </OBJECT>

Modified: pkg/distr/chm/UnivariateDistribution-class.html
===================================================================
--- pkg/distr/chm/UnivariateDistribution-class.html	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/chm/UnivariateDistribution-class.html	2008-11-24 13:08:41 UTC (rev 346)
@@ -122,8 +122,6 @@
 <p>
 returns the class of the object and its parameters</dd>
 <dt>show</dt><dd><code>signature(object = "UnivariateDistribution")</code>:
-</p>
-<p>
 as print</dd>
 </dl>
 

Modified: pkg/distr/demo/ComparisonFFTandRtoDPQ.R
===================================================================
--- pkg/distr/demo/ComparisonFFTandRtoDPQ.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/ComparisonFFTandRtoDPQ.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,4 +1,5 @@
 require(distr)
+options("newDevice"=TRUE)
 Pause <- function() { cat("Hit <enter> to continue..."); readline()}
 
 #################################################

Modified: pkg/distr/demo/ConvolutionNormalDistr.R
===================================================================
--- pkg/distr/demo/ConvolutionNormalDistr.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/ConvolutionNormalDistr.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -2,6 +2,7 @@
 ## Demo: Convolution of normal distributions   
 ###########################################################
 require(distr)
+options("newDevice"=TRUE)
 
 ## initialize two normal distributions
 A <- Norm(mean=1, sd=2)

Modified: pkg/distr/demo/Expectation.R
===================================================================
--- pkg/distr/demo/Expectation.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/Expectation.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,4 +1,5 @@
 require(distr)
+options("newDevice"=TRUE)
 
 if(!isGeneric("E")) 
    setGeneric("E", 

Modified: pkg/distr/demo/NormApprox.R
===================================================================
--- pkg/distr/demo/NormApprox.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/NormApprox.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,4 +1,5 @@
 require(distr)
+options("newDevice"=TRUE)
 
 N <- Norm(0,1)
 U <- Unif(0,1)

Modified: pkg/distr/demo/StationaryRegressorDistr.R
===================================================================
--- pkg/distr/demo/StationaryRegressorDistr.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/StationaryRegressorDistr.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -3,6 +3,7 @@
 ##       Process
 #####################################################
 require(distr)
+options("newDevice"=TRUE)
 
 ## Approximation of the stationary regressor 
 ## distribution of an AR(1) process 

Modified: pkg/distr/demo/destructive.R
===================================================================
--- pkg/distr/demo/destructive.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/destructive.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -2,6 +2,7 @@
 ## Demo: Instructive destructive example
 ##########################################################
 require(distr)
+options("newDevice"=TRUE)
 
 ## package "distr" encourages 
 ## consistency but does not 

Modified: pkg/distr/demo/nFoldConvolution.R
===================================================================
--- pkg/distr/demo/nFoldConvolution.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/nFoldConvolution.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -3,6 +3,7 @@
 ##       probability distributions
 ##########################################################
 require(distr)
+options("newDevice"=TRUE)
 
 ### from version 1.9 of distr on available in the package
 ### already

Modified: pkg/distr/demo/range.R
===================================================================
--- pkg/distr/demo/range.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/demo/range.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,4 +1,5 @@
 require(distr)
+options("newDevice"=TRUE)
 
 ## argument names conformal to use in distrEx
 

Modified: pkg/distr/man/UnivariateDistribution-class.Rd
===================================================================
--- pkg/distr/man/UnivariateDistribution-class.Rd	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distr/man/UnivariateDistribution-class.Rd	2008-11-24 13:08:41 UTC (rev 346)
@@ -83,13 +83,12 @@
 
       returns the class of the object and its parameters}
     \item{show}{\code{signature(object = "UnivariateDistribution")}:
-
       as print}
       }
   }
-}
 
 
+
 \author{
   Thomas Stabla \email{statho3 at web.de},\cr 
   Florian Camphausen \email{fcampi at gmx.de},\cr

Modified: pkg/distrEx/demo/Prognose.R
===================================================================
--- pkg/distrEx/demo/Prognose.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrEx/demo/Prognose.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,4 +1,5 @@
 require(distrEx) 
+options("newDevice"=TRUE)
 
 ## by M. Kohl
 ## slightly modified by P.R. [for more recent versions of our packages]

Modified: pkg/distrEx/demo/distrExUse.R
===================================================================
--- pkg/distrEx/demo/distrExUse.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrEx/demo/distrExUse.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,27 +1,9 @@
-require(distrEx)
 
-### Why distrEx is useful ---  a convincing demonstration
-
-N <- Norm(mean = 2, sd = 1.3)
-P <- Pois(lambda = 1.2)
-Z <- 2 * N + 3 + P # exact transformation
-
-### examining what N, P, Z are:
-plot(Z)
-p(Z)(0.4)
-q(Z)(0.3)
-r(Z)(10)
-
-## something weird
-Znew <- sin(abs(Z)) # by simulations
-plot(Znew)
-p(Znew)(0.2)
-
-
 ####################################################################################
 # example expectation operator
 ####################################################################################
 require("distrEx")
+options("newDevice"=TRUE)
 
 D1 <- Norm(mean=2)
 m1 <- E(D1)  # = 2

Modified: pkg/distrMod/demo/censoredPois.R
===================================================================
--- pkg/distrMod/demo/censoredPois.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/demo/censoredPois.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,3 +1,6 @@
+require(distrMod)
+options("newDevice"=TRUE)
+
 CensoredPoisFamily <- function(lambda = 1, trunc.pt = 2){
     ## name
     name <- "Censored Poisson family"

Modified: pkg/distrMod/demo/modelExp3.R
===================================================================
--- pkg/distrMod/demo/modelExp3.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/demo/modelExp3.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,3 +1,6 @@
+require(distrMod)
+options("newDevice"=TRUE)
+
 ## generation of distribution with density ~ e^{-|x|^3
 myD <- AbscontDistribution(d = function(x) exp(-abs(x)^3),
                            withS = TRUE)

Modified: pkg/distrMod/inst/scripts/BetaFam.R
===================================================================
--- pkg/distrMod/inst/scripts/BetaFam.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/inst/scripts/BetaFam.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,5 +1,6 @@
 ### some further examples:
 require(distrMod)
+options("newDevice"=TRUE)
 
 
 ### Beta Family

Modified: pkg/distrMod/inst/scripts/PoisFam.R
===================================================================
--- pkg/distrMod/inst/scripts/PoisFam.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/inst/scripts/PoisFam.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,5 +1,6 @@
 ### some further examples:
 require(distrMod)
+options("newDevice"=TRUE)
 
 ### Poisson Family
 P <- PoisFamily(3)

Modified: pkg/distrMod/inst/scripts/censoredPois.R
===================================================================
--- pkg/distrMod/inst/scripts/censoredPois.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/inst/scripts/censoredPois.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -3,6 +3,8 @@
 ### i.e. we only observe values if they are larger than
 ##  a lower truncation point
 ##########################################################
+require(distrMod)
+options("newDevice"=TRUE)
 
 CensoredPoisFamily <- function(lambda = 1, trunc.pt = 2){
     ## name

Modified: pkg/distrMod/inst/scripts/example_CvMMDE.R
===================================================================
--- pkg/distrMod/inst/scripts/example_CvMMDE.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/inst/scripts/example_CvMMDE.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,9 +1,10 @@
 require(distrMod)
+options("newDevice"=TRUE)
 
 ## example to CvM MDE for Normal Location and Scale
 
-x=rnorm(30)
-NF=NormLocationScaleFamily()
+x <- rnorm(30)
+NF <- NormLocationScaleFamily()
 
 system.time(print(MDEstimator(x,NF,CvMDist)))
 #with useApply

Modified: pkg/distrMod/inst/scripts/examples2.R
===================================================================
--- pkg/distrMod/inst/scripts/examples2.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/inst/scripts/examples2.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,5 +1,6 @@
 ### some further examples:
 require(distrMod)
+options("newDevice"=TRUE)
 
 ### Poisson Family
 P <- PoisFamily(3)

Modified: pkg/distrMod/inst/scripts/modelExp3.R
===================================================================
--- pkg/distrMod/inst/scripts/modelExp3.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrMod/inst/scripts/modelExp3.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -3,6 +3,7 @@
 ##########################################################
 
 require(distrMod)
+options("newDevice"=TRUE)
 
 my3d <- AbscontDistribution( d = function(x) exp(-abs(x)^3), withS = TRUE)
 plot(my3d)

Modified: pkg/distrSim/demo/Simulate.R
===================================================================
--- pkg/distrSim/demo/Simulate.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrSim/demo/Simulate.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,4 +1,5 @@
 require(distrSim)
+options("newDevice"=TRUE)
 
 sim <- new("Simulation",
            seed = setRNG(),

Modified: pkg/distrTEst/demo/SimulateandEstimate.R
===================================================================
--- pkg/distrTEst/demo/SimulateandEstimate.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrTEst/demo/SimulateandEstimate.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -1,4 +1,5 @@
 require(distrTEst)
+options("newDevice"=TRUE)
 
 sim <- new("Simulation",
            seed = setRNG(),

Modified: pkg/distrTeach/demo/illustCLT.R
===================================================================
--- pkg/distrTeach/demo/illustCLT.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrTeach/demo/illustCLT.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -5,6 +5,7 @@
 ##         sleep ^= duration of the pause between the different plots
 
 require(distrTeach)
+options("newDevice"=TRUE)
 # some examples
 # distroptions("DefaultNrFFTGridPointsExponent" = 13)
 illustrateCLT(Distr = Unif(), len = 20, sleep = 0.5)

Modified: pkg/distrTeach/demo/illustCLT_tcl.R
===================================================================
--- pkg/distrTeach/demo/illustCLT_tcl.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrTeach/demo/illustCLT_tcl.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -4,6 +4,8 @@
 
 require(tcltk) || stop("tcltk support is absent")
 require(graphics); require(stats); require(distrTeach)
+options("newDevice"=TRUE)
+
 local({
 
     k    <- tclVar(1)

Modified: pkg/distrTeach/demo/illustLLN.R
===================================================================
--- pkg/distrTeach/demo/illustLLN.R	2008-11-24 09:09:46 UTC (rev 345)
+++ pkg/distrTeach/demo/illustLLN.R	2008-11-24 13:08:41 UTC (rev 346)
@@ -13,6 +13,7 @@
 ##           ... ^= further arguments to plot
 
 require(distrTeach)
+options("newDevice"=TRUE)
 # some examples
 # distroptions("DefaultNrFFTGridPointsExponent" = 13)
 illustrateLLN(Distr = Norm(0,3), sleep = 0.1)



More information about the Distr-commits mailing list