[Distr-commits] r343 - in pkg: SweaveListingUtils/man distr distr/R distr/chm distr/man distrDoc/man distrEx/man distrMod/man distrSim/man distrTEst/man distrTeach/man utils

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 21 15:01:20 CET 2008


Author: ruckdeschel
Date: 2008-11-21 15:01:20 +0100 (Fri, 21 Nov 2008)
New Revision: 343

Modified:
   pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
   pkg/distr/DESCRIPTION
   pkg/distr/R/LatticeDistribution.R
   pkg/distr/R/bAcDcLcDistribution.R
   pkg/distr/R/bAffLinUnivarLebDecDistribution.R
   pkg/distr/R/internalUtils.R
   pkg/distr/R/internalUtils_LCD.R
   pkg/distr/chm/00Index.html
   pkg/distr/chm/Distr.chm
   pkg/distr/chm/Distr.toc
   pkg/distr/chm/UnivarLebDecDistribution-class.html
   pkg/distr/chm/internals.html
   pkg/distr/man/0distr-package.Rd
   pkg/distr/man/UnivarLebDecDistribution-class.Rd
   pkg/distr/man/internals.Rd
   pkg/distrDoc/man/0distrDoc-package.Rd
   pkg/distrEx/man/0distrEx-package.Rd
   pkg/distrMod/man/0distrMod-package.Rd
   pkg/distrSim/man/0distrSim-package.Rd
   pkg/distrTEst/man/0distrTEst-package.Rd
   pkg/distrTeach/man/0distrTeach-package.Rd
   pkg/utils/DESCRIPTIONutils.R
   pkg/utils/finde.r
Log:
*finde in utils can now be used recursively to find expressions in text files in some subfolder
*updatePackageHelp can now be used with sapply (checks if DESCRIPTION file exists) and correctly masks \
 [used this for updating Package DESCRIPTION information in package help files]
*slot r is now /much/ faster / slimmer for results of *,/,^ (no split in pos/neg part necessary for this!)
*slot d for results of *,/, exp() now is correct at 0 by extrapolation 
 (and deletion wir .del0dmixfun of half of the part to avoid double counting in *,/)
*affine linear trafos return slot X0 of AffLin-Construction if resulting a=1 and b=0
*more freguent use of .isEqual
*updated "Date" tag in DESCRIPTION to package distr
*updated Package DESCRIPTION information in package help files

Modified: pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
===================================================================
--- pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -14,12 +14,12 @@
 }
 \details{
 \tabular{ll}{
-Package: \tab SweaveListingUtils\cr
-Version: \tab 0.1.1\cr
-Date: \tab 2008-11-19\cr
-Depends: \tab R(>= 2.7.0)\cr
-
-LazyLoad: \tab yes\cr
+Package: \\tab SweaveListingUtils\cr
+Version: \\tab 0.1.1\cr
+Date: \\tab 2008-11-19\cr
+Depends: \\tab R(>= 2.0.0), startupmsg\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 License: \tab LGPL-3\cr
 }
 

Modified: pkg/distr/DESCRIPTION
===================================================================
--- pkg/distr/DESCRIPTION	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/DESCRIPTION	2008-11-21 14:01:20 UTC (rev 343)
@@ -1,6 +1,6 @@
 Package: distr
 Version: 2.0.3
-Date: 2008-11-19
+Date: 2008-11-21
 Title: Object orientated implementation of distributions
 Description: Object orientated implementation of distributions
 Author: Florian Camphausen, Matthias Kohl, Peter Ruckdeschel, Thomas

Modified: pkg/distr/R/LatticeDistribution.R
===================================================================
--- pkg/distr/R/LatticeDistribution.R	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/R/LatticeDistribution.R	2008-11-21 14:01:20 UTC (rev 343)
@@ -286,7 +286,7 @@
 
 setMethod("*", c("LatticeDistribution", "numeric"),
           function(e1, e2) 
-             {if (isTRUE(all.equal(e2,0)))
+             {if (.isEqual(e2,0))
                   return(Dirac( location = 0 ))
               else     
                 { L <- lattice(e1)

Modified: pkg/distr/R/bAcDcLcDistribution.R
===================================================================
--- pkg/distr/R/bAcDcLcDistribution.R	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/R/bAcDcLcDistribution.R	2008-11-21 14:01:20 UTC (rev 343)
@@ -31,6 +31,7 @@
                        as(exp(log(e1DC$pos$D)+log(e2DC$pos$D)),
                           "UnivarLebDecDistribution")
                   else as(Dirac(1), "UnivarLebDecDistribution")
+         
          e12mm <- if(w12mm>ep)
                        as(exp(log(-e1DC$neg$D)+log(-e2DC$neg$D)),
                           "UnivarLebDecDistribution")
@@ -45,13 +46,27 @@
                                  "UnivarLebDecDistribution")
                        else as(Dirac(-1), "UnivarLebDecDistribution")
 
+         e12pm <- .del0dmixfun(e12pm)
+         e12mp <- .del0dmixfun(e12mp)
+         
          obj <- flat.LCD(mixCoeff = mixCoeff,
                          e12pp, e12mm, e12pm, e12mp,
                          as(Dirac(0),"UnivarLebDecDistribution"))
-
+         
+         dnew <- function(x, log = FALSE, ...){
+               d0 <- dnew0(x, log = log, ...)
+               i0 <- .isEqual(x,0)
+               if(!any(i0)) return(d0)
+               if(log) d0[i0] <- lf0 else d0[i0] <- f0
+               return(d0)
+            }
          if(getdistrOption("simplifyD"))
             obj <- simplifyD(obj)
 
+         rnew <- function(n, ...){}
+         body(rnew) <- substitute({ g1(n, ...) * g2(n, ...) },
+                                    list(g1 = e1 at r, g2 = e2 at r)) 
+         obj at r <- rnew
          return(obj)
          })
 
@@ -88,7 +103,13 @@
          if(getdistrOption("simplifyD"))
             e2D <- simplifyD(e2D)
 
-         e1*e2D
+         obj <- e1*e2D
+         
+         rnew <- function(n, ...){}
+         body(rnew) <- substitute({ g1 / g2(n, ...) },
+                                    list(g1 = e1, g2 = e2 at r)) 
+         obj at r <- rnew
+         return(obj)
          })
 
 setMethod("/", c("AcDcLcDistribution",
@@ -105,7 +126,14 @@
          if (discreteWeight(e2)>getdistrOption("TruncQuantile"))
          if (d.discrete(e2)(0)>getdistrOption("TruncQuantile"))
             stop(gettextf("1 / %s is not well-defined with positive probability ", e2s))
-         e1 * (1/e2)
+
+         obj <- e1 * (1/e2)
+
+         rnew <- function(n, ...){}
+         body(rnew) <- substitute({ g1(n, ...) / g2(n, ...) },
+                                    list(g1 = e1 at r, g2 = e2 at r)) 
+         obj at r <- rnew
+         return(obj)
          })
 
 setMethod("^", c("AcDcLcDistribution","Integer"),
@@ -152,6 +180,11 @@
              }
            if(getdistrOption("simplifyD")) 
                 erg <- simplifyD(erg)
+
+           rnew <- function(n, ...){}
+           body(rnew) <- substitute({ g1(n, ...)^g2 },
+                                    list(g1 = e1 at r, g2 = e2)) 
+           erg at r <- rnew
            return(erg)
            })
 
@@ -218,6 +251,12 @@
   
   if(getdistrOption("simplifyD"))
             erg <- simplifyD(erg)
+
+  rnew <- function(n, ...){}
+  body(rnew) <- substitute({ g1(n, ...)^g2 },
+                            list(g1 = e1 at r, g2 = e2)) 
+  erg at r <- rnew
+
   return(erg)          
   }
 )
@@ -296,6 +335,12 @@
  le <- le1 * e2
  erg <- exp(le)
  if(getdistrOption("simplifyD")) erg <- simplifyD(erg)
+
+ rnew <- function(n, ...){}
+ body(rnew) <- substitute({ g1(n, ...)^g2(n, ...) },
+                            list(g1 = e1 at r, g2 = e2 at r)) 
+ erg at r <- rnew
+
  return(erg)                
 })
 
@@ -355,10 +400,16 @@
   le <- le1 * e2
   erg <- exp(le)
   if(getdistrOption("simplifyD")) erg <- simplifyD(erg)
+
+  rnew <- function(n, ...){}
+  body(rnew) <- substitute({ g1^g2(n, ...) },
+                            list(g1 = e1, g2 = e2 at r)) 
+  erg at r <- rnew
+
   return(erg)                
 })
 
-  setMethod("sign", "AcDcLcDistribution",
+setMethod("sign", "AcDcLcDistribution",
             function(x){ 
             if(is(x,"AbscontDistribution")) d0 <-0
             else if(is(x,"DiscreteDistribution")) d0 <- d(x)(0)
@@ -368,3 +419,6 @@
                        d0,
                        p(x)(getdistrOption("TruncQuantile"), lower=FALSE)))                     
             })
+
+setMethod("sqrt", "AcDcLcDistribution",
+            function(x) x^0.5)

Modified: pkg/distr/R/bAffLinUnivarLebDecDistribution.R
===================================================================
--- pkg/distr/R/bAffLinUnivarLebDecDistribution.R	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/R/bAffLinUnivarLebDecDistribution.R	2008-11-21 14:01:20 UTC (rev 343)
@@ -17,9 +17,15 @@
                      discreteWeight = discreteWeight(e1),
                      acWeight = acWeight(e1))
 
+          if(.isEqual(e1 at a*e2,1)&&.isEqual(e1 at b,0)){
+             obj <- e1 at X0
+             if(getdistrOption("simplifyD"))
+                obj <- simplifyD(obj)
+             return(obj)
+          }   
           object <- new("AffLinUnivarLebDecDistribution",
                     r = Distr at r, d = Distr at d, p = Distr at p,
-                    q = Distr at q, X0 = e1, mixDistr = Distr at mixDistr,
+                    q = Distr at q, X0 = e1 at X0, mixDistr = Distr at mixDistr,
                     mixCoeff = Distr at mixCoeff,
                     a = e1 at a*e2, b = e1 at b, .withSim  = e1 at .withSim,
                     .withArith = TRUE)
@@ -36,9 +42,16 @@
                      discreteWeight = discreteWeight(e1),
                      acWeight = acWeight(e1))
 
+          if(.isEqual(e1 at a,1)&&.isEqual(e1 at b+e2,0)){
+             obj <- e1 at X0
+             if(getdistrOption("simplifyD"))
+                obj <- simplifyD(obj)
+             return(obj)
+          }   
+          
           object <- new("AffLinUnivarLebDecDistribution",
                     r = Distr at r, d = Distr at d, p = Distr at p,
-                    q = Distr at q, X0 = e1, mixDistr = Distr at mixDistr,
+                    q = Distr at q, X0 = e1 at X0, mixDistr = Distr at mixDistr,
                     mixCoeff = Distr at mixCoeff,
                     a = e1 at a, b = e1 at b+e2, .withSim  = e1 at .withSim,
                     .withArith = TRUE)

Modified: pkg/distr/R/internalUtils.R
===================================================================
--- pkg/distr/R/internalUtils.R	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/R/internalUtils.R	2008-11-21 14:01:20 UTC (rev 343)
@@ -360,8 +360,12 @@
 
 .plusm <- function(e1, e2, Dclass = "DiscreteDistribution"){
             if (length(e2)>1) stop("length of operator must be 1")
-            if (isTRUE(all.equal(e2, 0, check.attributes = FALSE))) return(e1)
+            if (.isEqual(e2, 0)) return(e1)
 
+            if(Dclass %in% c("AffLinDiscreteDistribution",
+                              "AffLinAbscontDistribution"))
+               if(.isEqual(e1 at a,1)&&.isEqual(e1 at b+e2,0)) return(e1 at X0)
+
             if ((Dclass == "DiscreteDistribution")||
                 (Dclass == "AffLinDiscreteDistribution"))
                 supportnew <- e1 at support + e2
@@ -412,10 +416,13 @@
 .multm <- function(e1, e2, Dclass = "DiscreteDistribution"){
             if (length(e2)>1) stop("length of operator must be 1")
 
-            if (isTRUE(all.equal(e2, 1, check.attributes = FALSE))) return(e1)
-            if (isTRUE(all.equal(e2, 0, check.attributes = FALSE)))
-               return(new("Dirac", location = 0))
+            if (.isEqual(e2, 1)) return(e1)
+            if (.isEqual(e2, 0))  return(new("Dirac", location = 0))
 
+            if(Dclass %in% c("AffLinDiscreteDistribution",
+                              "AffLinAbscontDistribution"))
+               if(.isEqual(e1 at a*e2,1)&&.isEqual(e1 at b,0)) return(e1 at X0)
+
             rnew <- function(n, ...){}
             body(rnew) <- substitute({ f(n, ...) * g },
                                          list(f = e1 at r, g = e2))
@@ -798,10 +805,26 @@
             rnew <- function(n, ...){}
             body(rnew) <- substitute({ exp(f(n, ...)) },
                                          list(f = e1 at r))
-            dnew <- .makeD(substitute(e1, list(e1 = e1)),
-                           substitute(alist(x = log(x*(x>0)+(x<=0)))),
-                           stand = substitute(x+(x==0)),
-                           fac = substitute((x>0)))
+                                    
+            
+            dnew0 <- .makeD(substitute(e1, list(e1 = e1)),
+                            substitute(alist(x = log(x*(x>0)+(x<=0)))),
+                            stand = substitute(x+(x==0)),
+                            fac = substitute((x>0)))
+
+            # extrapolation for x=0
+            x0a <- 10^(-(1:10)/4) 
+            f0a <- dnew0(x = x0a, log = FALSE)
+            f0  <- max(spline(x0a,f0a, xout = 0)$y,0)
+            lf0 <- log(f0)
+
+            dnew <- function(x, log = FALSE, ...){
+               d0 <- dnew0(x, log = log, ...)
+               i0 <- .isEqual(x,0)
+               if(!any(i0)) return(d0)
+               if(log) d0[i0] <- lf0 else d0[i0] <- f0
+               return(d0)
+            }
             pnew <- .makeP(substitute(e1, list(e1 = e1)),
                            substitute(alist(q = log(q*(q>0)+(q<=0)))),
                            fac = substitute((q>0)),

Modified: pkg/distr/R/internalUtils_LCD.R
===================================================================
--- pkg/distr/R/internalUtils_LCD.R	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/R/internalUtils_LCD.R	2008-11-21 14:01:20 UTC (rev 343)
@@ -157,3 +157,16 @@
     qU  <- max(qU0); qu <- max(qU1)
     return(list(qL = qL, ql = ql, qU = qU, qu = qu))
     }
+
+.del0dmixfun <- function(mixDistr){
+  dac <- mixDistr at mixDistr[[1]]@d
+  if(!is.null(dac)){
+      dnew <- function(x, log = FALSE, ...){
+               d0 <- dac(x, log = log, ...)
+               d0[.isEqual(x,0)] <-  0
+               return(d0)
+            }
+      mixDistr at mixDistr[[1]]@d <- dnew
+  }
+  return(mixDistr)
+}

Modified: pkg/distr/chm/00Index.html
===================================================================
--- pkg/distr/chm/00Index.html	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/chm/00Index.html	2008-11-21 14:01:20 UTC (rev 343)
@@ -1497,6 +1497,8 @@
 <td>Methods for Function size in Package &lsquo;distr&rsquo; </td></tr>
 <tr><td width="25%"><a href="size-methods.html">size&lt;--methods</a></td>
 <td>Methods for Function size in Package &lsquo;distr&rsquo; </td></tr>
+<tr><td width="25%"><a href="UnivarLebDecDistribution-class.html">sqrt,AcDcLcDistribution-method</a></td>
+<td>Class "UnivarLebDecDistribution"</td></tr>
 <tr><td width="25%"><a href="standardMethods.html">standardMethods</a></td>
 <td>Utility to automatically generate accessor and replacement functions</td></tr>
 <tr><td width="25%"><a href="support-methods.html">support</a></td>

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

Modified: pkg/distr/chm/Distr.toc
===================================================================
--- pkg/distr/chm/Distr.toc	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/chm/Distr.toc	2008-11-21 14:01:20 UTC (rev 343)
@@ -310,6 +310,10 @@
 <param name="Local" value="internals.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value=".del0dmixfun">
+<param name="Local" value="internals.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value=".discretizeP">
 <param name="Local" value="internals.html">
 </OBJECT>
@@ -3094,6 +3098,10 @@
 <param name="Local" value="size-methods.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="sqrt,AcDcLcDistribution-method">
+<param name="Local" value="UnivarLebDecDistribution-class.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="standardMethods">
 <param name="Local" value="standardMethods.html">
 </OBJECT>

Modified: pkg/distr/chm/UnivarLebDecDistribution-class.html
===================================================================
--- pkg/distr/chm/UnivarLebDecDistribution-class.html	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/chm/UnivarLebDecDistribution-class.html	2008-11-21 14:01:20 UTC (rev 343)
@@ -68,6 +68,7 @@
 <param name="keyword" value="R:   exp,UnivarLebDecDistribution-method">
 <param name="keyword" value="R:   sign,UnivarLebDecDistribution-method">
 <param name="keyword" value="R:   sign,AcDcLcDistribution-method">
+<param name="keyword" value="R:   sqrt,AcDcLcDistribution-method">
 <param name="keyword" value=" Class 'UnivarLebDecDistribution'">
 </object>
 
@@ -161,6 +162,7 @@
 <code>exp</code>{<code>signature(x = "UnivarLebDecDistribution")</code>:  exact image distribution of <code>exp(x)</code>.}
 <code>sign</code>{<code>signature(x = "UnivarLebDecDistribution")</code>:  exact image distribution of <code>sign(x)</code>.}
 <code>sign</code>{<code>signature(x = "AcDcLcDistribution")</code>:  exact image distribution of <code>sign(x)</code>.}
+<code>sqrt</code>{<code>signature(x = "AcDcLcDistribution")</code>:  exact image distribution of <code>sqrt(x)</code>.}
 <code>log</code>{<code>signature(x = "UnivarLebDecDistribution")</code>:  (with optional further argument <code>base</code>, 
 defaulting to <code>exp(1)</code>) exact image distribution of <code>log(x)</code>.}
 <code>log10</code>{<code>signature(x = "UnivarLebDecDistribution")</code>:  exact image distribution of <code>log10(x)</code>.}
@@ -283,6 +285,6 @@
 
 
 
-<hr><div align="center">[Package <em>distr</em> version 2.0 <a href="00Index.html">Index]</a></div>
+<hr><div align="center">[Package <em>distr</em> version 2.0.3 <a href="00Index.html">Index]</a></div>
 
 </body></html>

Modified: pkg/distr/chm/internals.html
===================================================================
--- pkg/distr/chm/internals.html	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/chm/internals.html	2008-11-21 14:01:20 UTC (rev 343)
@@ -17,6 +17,7 @@
 <param name="keyword" value="R:   .dmixfun">
 <param name="keyword" value="R:   .qmixfun">
 <param name="keyword" value="R:   .rmixfun">
+<param name="keyword" value="R:   .del0dmixfun">
 <param name="keyword" value="R:   .loupmixfun">
 <param name="keyword" value="R:   .make.lattice.es.vector">
 <param name="keyword" value="R:   .presubs">
@@ -53,6 +54,7 @@
 <param name="keyword" value="R:   .Q2P">
 <param name="keyword" value="R:   .csimpsum">
 <param name="keyword" value="R:   .primefun">
+<param name="keyword" value="R:   .IssueWarn">
 <param name="keyword" value="R:   devNew">
 <param name="keyword" value=" Internal functions of package distr">
 </object>
@@ -112,6 +114,7 @@
 .dmixfun(mixDistr, mixCoeff, withStand = FALSE, supp = NULL)
 .rmixfun(mixDistr, mixCoeff)
 .qmixfun(mixDistr, mixCoeff, Cont = TRUE, pnew)
+.del0dmixfun(mixDistr)
 .loupmixfun(mixDistr)
 .expm.d(e1)
 .expm.c(e1)
@@ -124,6 +127,7 @@
 .Q2P (q, ngrid = getdistrOption("DefaultNrGridPoints"))
 .csimpsum(fx)
 .primefun(f,x, nm = NULL)
+.IssueWarn(Arith,Sim)
 devNew(...)
 </pre>
 
@@ -320,6 +324,14 @@
 <tr valign="top"><td><code>nm</code></td>
 <td>
 an optional right asymptotic value</td></tr>
+<tr valign="top"><td><code>Arith</code></td>
+<td>
+logical; slot <code>.withArith</code> of a distribution object,
+or logically-``any'' of these slots in a collection of such objects</td></tr>
+<tr valign="top"><td><code>Sim</code></td>
+<td>
+logical; slot <code>.withSim</code> of a distribution object,
+or logically-``any'' of these slots in a collection of such objects</td></tr>
 <tr valign="top"><td><code>...</code></td>
 <td>
 arguments passed through to other functions</td></tr>
@@ -428,6 +440,13 @@
 <p>
 <code>.loupmixfun</code> finds commun lower and upper bounds for the support of
 the mixing distribution.
+</p>
+<p>
+<code>.del0dmixfun</code> sets (if slot <code>d.ac</code> is not <code>NULL</code>) the return
+value of slot function <code>d.ac</code> of <code>mixDistr</code> 
+for argument <code>0</code> to <code>0</code>.
+</p>
+<p>
 <code>.expm.d,.expm.c</code> for discrete, resp. a.c. argument <code>e1</code> fill the 
 slots <code>p</code>, <code>d</code>, <code>r</code>, and <code>q</code>
 of the transformation <code>exp(e1)</code> exactly.
@@ -535,6 +554,9 @@
 <td>
 slot <code>r</code> for a mixing distribution, i.e. a function 
 <code>function(n)</code> generating r.v.'s according to the distribution</td></tr>
+<tr valign="top"><td><code>.deldmixfun</code></td>
+<td>
+a possibly modified argument <code>mixDistr</code></td></tr>
 <tr valign="top"><td><code>.loupmixfun</code></td>
 <td>
 a list of four components: <code>qL</code>, the minimal value of 
@@ -559,6 +581,7 @@
             lower.tail = TRUE, log.p = FALSE)</code>}
 <code>.csimpsum</code>{a vector of evaluations of the prime function at the grid points}
 <code>.primefun</code>{the prime function as a function}
+<code>.IssueWarn</code>{a list with two warnings to be issued each of which may be empty}
 <code>devNew</code>{returns the return value of the device opened, usually invisible 'NULL'}</p>
 
 <h3>Author(s)</h3>
@@ -594,6 +617,6 @@
 </script>
 
 
-<hr><div align="center">[Package <em>distr</em> version 2.0 <a href="00Index.html">Index]</a></div>
+<hr><div align="center">[Package <em>distr</em> version 2.0.3 <a href="00Index.html">Index]</a></div>
 
 </body></html>

Modified: pkg/distr/man/0distr-package.Rd
===================================================================
--- pkg/distr/man/0distr-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/man/0distr-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -42,12 +42,13 @@
 
 \details{
 \tabular{ll}{
-Package: \tab distr\cr
-Version: \tab 2.0.3 \cr
-Date: \tab 2008-11-19 \cr
-Depends: \tab R(>= 2.2.0), methods, graphics, startupmsg, sfsmisc\cr
-Imports: \tab stats\cr
-LazyLoad: \tab yes\cr
+Package: \\tab distr\cr
+Version: \\tab 2.0.3\cr
+Date: \\tab 2008-11-21\cr
+Depends: \\tab R(>= 2.2.0), methods, graphics, startupmsg, sfsmisc,
+SweaveListingUtils\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 License: \tab LGPL-3\cr
 URL: \tab http://distr.r-forge.r-project.org/\cr
 }}

Modified: pkg/distr/man/UnivarLebDecDistribution-class.Rd
===================================================================
--- pkg/distr/man/UnivarLebDecDistribution-class.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/man/UnivarLebDecDistribution-class.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -63,6 +63,7 @@
 \alias{exp,UnivarLebDecDistribution-method}
 \alias{sign,UnivarLebDecDistribution-method}
 \alias{sign,AcDcLcDistribution-method}
+\alias{sqrt,AcDcLcDistribution-method}
 
 \title{Class "UnivarLebDecDistribution"}
 \description{\code{UnivarLebDecDistribution}-class is a class to formalize
@@ -135,6 +136,7 @@
     \code{exp}{\code{signature(x = "UnivarLebDecDistribution")}:  exact image distribution of \code{exp(x)}.}
     \code{sign}{\code{signature(x = "UnivarLebDecDistribution")}:  exact image distribution of \code{sign(x)}.}
     \code{sign}{\code{signature(x = "AcDcLcDistribution")}:  exact image distribution of \code{sign(x)}.}
+    \code{sqrt}{\code{signature(x = "AcDcLcDistribution")}:  exact image distribution of \code{sqrt(x)}.}
     \code{log}{\code{signature(x = "UnivarLebDecDistribution")}:  (with optional further argument \code{base}, 
     defaulting to \code{exp(1)}) exact image distribution of \code{log(x)}.}
     \code{log10}{\code{signature(x = "UnivarLebDecDistribution")}:  exact image distribution of \code{log10(x)}.}

Modified: pkg/distr/man/internals.Rd
===================================================================
--- pkg/distr/man/internals.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distr/man/internals.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -11,6 +11,7 @@
 \alias{.dmixfun}
 \alias{.qmixfun}
 \alias{.rmixfun}
+\alias{.del0dmixfun}
 \alias{.loupmixfun}
 \alias{.make.lattice.es.vector}
 \alias{.presubs}
@@ -97,6 +98,7 @@
 .dmixfun(mixDistr, mixCoeff, withStand = FALSE, supp = NULL)
 .rmixfun(mixDistr, mixCoeff)
 .qmixfun(mixDistr, mixCoeff, Cont = TRUE, pnew)
+.del0dmixfun(mixDistr)
 .loupmixfun(mixDistr)
 .expm.d(e1)
 .expm.c(e1)
@@ -291,6 +293,11 @@
 
 \code{.loupmixfun} finds commun lower and upper bounds for the support of
 the mixing distribution.
+
+\code{.del0dmixfun} sets (if slot \code{d.ac} is not \code{NULL}) the return
+value of slot function \code{d.ac} of \code{mixDistr} 
+for argument \code{0} to \code{0}.
+
 \code{.expm.d,.expm.c} for discrete, resp. a.c. argument \code{e1} fill the 
 slots \code{p}, \code{d}, \code{r}, and \code{q}
 of the transformation \code{exp(e1)} exactly.
@@ -353,6 +360,7 @@
                 is  the quantile function of the distribution}
 \item{.rmixfun}{slot \code{r} for a mixing distribution, i.e. a function 
                 \code{function(n)} generating r.v.'s according to the distribution}
+\item{.deldmixfun}{a possibly modified argument \code{mixDistr}}
 \item{.loupmixfun}{a list of four components: \code{qL}, the minimal value of 
 \code{q(x)(0)}, \code{ql}, the minimal value of 
 \code{q(x)(getdistrOption("TruncQuantile"))}, \code{qU}, the maximal value of 

Modified: pkg/distrDoc/man/0distrDoc-package.Rd
===================================================================
--- pkg/distrDoc/man/0distrDoc-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distrDoc/man/0distrDoc-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -13,12 +13,12 @@
 }
 \details{
 \tabular{ll}{
-Package: \tab distrDoc\cr
-Version: \tab 2.0.3 \cr
-Date: \tab 2008-11-19 \cr
-Depends: \tab R(>= 2.6.0), tools, distr(>= 2.0.0), startupmsg\cr
-Suggests: \tab distrEx(>= 2.0.0), distrSim(>= 2.0.0), distrTEst(>= 2.0.0), distrTeach(>= 2.0.0), distrMod(>= 2.0.0), Biobase\cr
-LazyLoad: \tab yes\cr
+Package: \\tab distrDoc\cr
+Version: \\tab 2.0.3\cr
+Date: \\tab 2008-11-19\cr
+Depends: \\tab R(>= 2.6.0), tools, distr(>= 2.0.0), startupmsg\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 License: \tab LGPL-3\cr
 URL: \tab http://distr.r-forge.r-project.org/\cr
 }}

Modified: pkg/distrEx/man/0distrEx-package.Rd
===================================================================
--- pkg/distrEx/man/0distrEx-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distrEx/man/0distrEx-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -25,12 +25,12 @@
 
 \details{
 \tabular{ll}{
-Package: \tab distrEx\cr
-Version: \tab 2.0.3 \cr
-Date: \tab 2008-11-19 \cr
-Depends: \tab R(>= 2.6.0), methods, distr(>= 2.0), evd, startupmsg\cr
-Suggests: \tab tcltk\cr
-LazyLoad: \tab yes\cr
+Package: \\tab distrEx\cr
+Version: \\tab 2.0.3\cr
+Date: \\tab 2008-11-19\cr
+Depends: \\tab R(>= 2.6.0), methods, distr(>= 2.0), evd, startupmsg\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 License: \tab LGPL-3\cr
 URL: \tab http://distr.r-forge.r-project.org/\cr
 }

Modified: pkg/distrMod/man/0distrMod-package.Rd
===================================================================
--- pkg/distrMod/man/0distrMod-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distrMod/man/0distrMod-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -14,12 +14,13 @@
 
 \details{
 \tabular{ll}{
-Package: \tab distrMod\cr
-Version: \tab 2.0.3 \cr
-Date: \tab 2008-11-19 \cr
-Depends: \tab R(>= 2.6.0), methods, startupmsg, distr(>= 2.0), distrEx(>= 2.0), \cr
-         \tab RandVar(>= 0.6.2), MASS, stats4\cr
-LazyLoad: \tab yes\cr
+Package: \\tab distrMod\cr
+Version: \\tab 2.0.3\cr
+Date: \\tab 2008-11-19\cr
+Depends: \\tab R(>= 2.6.0), methods, startupmsg, distr(>= 2.0), distrEx(>=
+2.0), RandVar(>= 0.6.3), MASS, stats4\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 License: \tab LGPL-3\cr
 URL: \tab http://distr.r-forge.r-project.org/\cr
 }}

Modified: pkg/distrSim/man/0distrSim-package.Rd
===================================================================
--- pkg/distrSim/man/0distrSim-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distrSim/man/0distrSim-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -12,12 +12,13 @@
 }
 \details{
 \tabular{ll}{
-Package: \tab distrSim\cr
-Version: \tab 2.0.2 \cr
-Date: \tab 2008-11-05 \cr
-Depends: \tab R(>= 2.6.0), methods, graphics, setRNG(>= 2006.2-1), distr(>= 2.0), startupmsg\cr
-Suggests: \tab distrEx(>= 2.0)\cr
-LazyLoad: \tab yes\cr
+Package: \\tab distrSim\cr
+Version: \\tab 2.0.2\cr
+Date: \\tab 2008-11-06\cr
+Depends: \\tab R(>= 2.6.0), methods, graphics, setRNG(>= 2006.2-1), distr(>=
+2.0), startupmsg\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 License: \tab LGPL-3\cr
 URL: \tab http://distr.r-forge.r-project.org/\cr
 }

Modified: pkg/distrTEst/man/0distrTEst-package.Rd
===================================================================
--- pkg/distrTEst/man/0distrTEst-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distrTEst/man/0distrTEst-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -14,12 +14,13 @@
 }
 \details{
 \tabular{ll}{
-Package: \tab distrTEst\cr
-Version: \tab 2.0.2 \cr
-Date: \tab 2008-11-05 \cr
-Depends: \tab R(>= 2.6.0), methods, graphics, setRNG(>= 2006.2-1), distr(>= 2.0), distrSim(>= 2.0), startupmsg\cr
-Suggests: \tab distrEx(>= 2.0)\cr
-Imports: \tab stats\cr
+Package: \\tab distrTEst\cr
+Version: \\tab 2.0.2\cr
+Date: \\tab 2008-11-06\cr
+Depends: \\tab R(>= 2.6.0), methods, graphics, setRNG(>= 2006.2-1), distr(>=
+2.0), distrSim(>= 2.0), startupmsg\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 LazyLoad: \tab yes\cr
 License: \tab LGPL-3\cr
 URL: \tab http://distr.r-forge.r-project.org/\cr

Modified: pkg/distrTeach/man/0distrTeach-package.Rd
===================================================================
--- pkg/distrTeach/man/0distrTeach-package.Rd	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/distrTeach/man/0distrTeach-package.Rd	2008-11-21 14:01:20 UTC (rev 343)
@@ -19,12 +19,13 @@
 
 \details{
 \tabular{ll}{
-Package: \tab distrTeach\cr
-Version: \tab 2.0.2 \cr
-Date: \tab 2008-11-05 \cr
-Depends: \tab R(>= 2.2.0), methods, distr(>= 1.8), distrEx(>= 2.0), startupmsg\cr
-Suggests: \tab tcltk\cr
-LazyLoad: \tab yes\cr
+Package: \\tab distrTeach\cr
+Version: \\tab 2.0.2\cr
+Date: \\tab 2008-11-06\cr
+Depends: \\tab R(>= 2.2.0), methods, distr(>= 2.0), distrEx(>= 2.0),
+startupmsg\cr
+LazyLoad: \\tab yes\cr
+License: \\tab LGPL-3\cr
 License: \tab LGPL-3\cr
 URL: \tab http://distr.r-forge.r-project.org/\cr
 }

Modified: pkg/utils/DESCRIPTIONutils.R
===================================================================
--- pkg/utils/DESCRIPTIONutils.R	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/utils/DESCRIPTIONutils.R	2008-11-21 14:01:20 UTC (rev 343)
@@ -1,22 +1,23 @@
 ### some utils for unified treatment of DESCRIPTION files from R
 
 updatePackageHelp <- function(package){
+  if(file.exists(file.path(package, "DESCRIPTION"))){
   DFF    <-  read.dcf(file = file.path(package, "DESCRIPTION"))
   mandir <-  dir(file.path(package, "man"))
   PFfileI <-  grep("-package", mandir, value = TRUE)
   if(length(PFfileI)){
   PFfile <- file.path(package, "man", PFfileI)
   PF     <-  readLines(con = PFfile)
-  PFb    <-  grep("Package: \\tab", PF)
+  PFb    <-  grep("Package: \\\\tab", PF)
   PFc    <-  PF
-  PFc[PFb] <- paste("Package: \\tab ", DFF[1,"Package"], "\\cr", sep = "")
-  PFc[PFb+1] <- paste("Version: \\tab ", DFF[1,"Version"], "\\cr", sep = "")
-  PFc[PFb+2] <- paste("Date: \\tab ", DFF[1,"Date"], "\\cr", sep = "")
-  PFc[PFb+3] <- paste("Depends: \\tab ", DFF[1,"Depends"], "\\cr", sep = "")
-  PFc[PFb+4] <- paste("LazyLoad: \\tab ", DFF[1,"LazyLoad"], "\\cr", sep = "")
-  PFc[PFb+5] <- paste("License: \\tab ", DFF[1,"License"], "\\cr", sep = "")
+  PFc[PFb] <- paste("Package: \\\\tab ", DFF[1,"Package"], "\\cr", sep = "")
+  PFc[PFb+1] <- paste("Version: \\\\tab ", DFF[1,"Version"], "\\cr", sep = "")
+  PFc[PFb+2] <- paste("Date: \\\\tab ", DFF[1,"Date"], "\\cr", sep = "")
+  PFc[PFb+3] <- paste("Depends: \\\\tab ", DFF[1,"Depends"], "\\cr", sep = "")
+  PFc[PFb+4] <- paste("LazyLoad: \\\\tab ", DFF[1,"LazyLoad"], "\\cr", sep = "")
+  PFc[PFb+5] <- paste("License: \\\\tab ", DFF[1,"License"], "\\cr", sep = "")
   writeLines(PFc, con = PFfile)
-  }
+  }}
 }
 
 
@@ -57,19 +58,29 @@
   }
 }
 
-Names <- c("Version", "License", "Date")
-Values <- matrix(c("2.0.2","LGPL-3",
-                             format(Sys.time(), format="%Y-%m-%d")),3,9)
 Pkgs <- c("startupmsg", "SweaveListingUtils",
                       "distr", "distrEx", "distrDoc",
                       "distrMod", "distrTeach", "distrSim", "distrTEst")
+Names <- c("Version", "License", "Date")
+Values <- matrix(c("2.0.2","LGPL-3",
+                             format(Sys.time(), format="%Y-%m-%d")),3,length(Pkgs))
 colnames(Values) <- Pkgs
 rownames(Values) <- Names
 Values["Version",] <- c("0.5.2", "0.1.1", "2.0.3", "2.0.2", "2.0.3",
                          rep("2.0.2",4))
-
 changeDescription(startDir = "C:/rtest/distr",names=Names,
                   pkgs=Pkgs, values=Values)
+
+
+Pkgs <- c("SweaveListingUtils", "distr")
+Names <- c("Date")
+Values <- matrix((format(Sys.time(), format="%Y-%m-%d")),1,length(Pkgs))
+colnames(Values) <- Pkgs
+rownames(Values) <- Names
+
+
+changeDescription(startDir = "C:/rtest/distr",names="Date", 
+                  pkgs=Pkgs, values=format(Sys.time(), format="%Y-%m-%d"))
                    
 copyDescription <- function(startDir){
   oldDir <- getwd()

Modified: pkg/utils/finde.r
===================================================================
--- pkg/utils/finde.r	2008-11-20 17:52:44 UTC (rev 342)
+++ pkg/utils/finde.r	2008-11-21 14:01:20 UTC (rev 343)
@@ -1,17 +1,25 @@
-finde <- function(x = "nchar", dir="C:/rtest/distr/pkg/distr/R", ext = "R"){
-ow <- getwd()
-setwd(dir)
-cat("\n")
-findL <- function(y){
-zz=readLines(y)
-lgr <- grep(x,zz)
-if(length(lgr>0))
-   cat(y," :: ",paste(lgr),"\n")
-invisible()
-}
-DIR <- grep(paste("\\.", ext, sep=""), dir(), value=TRUE)
-s = lapply(DIR,findL)
+finde <- function(x = "nchar", dir="C:/rtest/distr/pkg/distr/R", ext = "R", rec = FALSE){
+  ow <- getwd()
+  infind <- function(dir0){
+    setwd(dir0)
+    cat("\n")
+    findL <- function(y){
+       zz <- readLines(y)
+       lgr <- grep(x,zz)
+       if(length(lgr>0)){
+          if(rec)
+             cat(paste(dir0,"/",y,sep="")," :: ",paste(lgr),"\n")
+          else cat(y," :: ",paste(lgr),"\n")
+       }
+       invisible()
+    }
+  ext0 <- if(ext=="") "" else paste("\\.", ext, sep="")
+  DIR <- grep(ext0, dir(, rec = rec), value=TRUE)
+  s <- lapply(DIR,findL)
+  }
+infind(dir)   
 setwd(ow)
 }
 finde(x=".makeQNew", dir ="C:/rtest/distr/pkg/distr/R")
+finde(x=".makeQNew", dir ="C:/rtest/distr/pkg/distr", rec=TRUE)
 



More information about the Distr-commits mailing list