[Distr-commits] r259 - in branches/distr-2.0/pkg: distr/R distr/chm distr/man distrDoc/inst/doc distrMod/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 12 02:31:06 CEST 2008


Author: ruckdeschel
Date: 2008-08-12 02:31:05 +0200 (Tue, 12 Aug 2008)
New Revision: 259

Modified:
   branches/distr-2.0/pkg/distr/R/0distrOptions.R
   branches/distr-2.0/pkg/distr/R/plot-methods.R
   branches/distr-2.0/pkg/distr/R/plot-methods_LebDec.R
   branches/distr-2.0/pkg/distr/chm/00Index.html
   branches/distr-2.0/pkg/distr/chm/Distr.chm
   branches/distr-2.0/pkg/distr/chm/Distr.toc
   branches/distr-2.0/pkg/distr/chm/distroptions.html
   branches/distr-2.0/pkg/distr/chm/plot-methods.html
   branches/distr-2.0/pkg/distr/man/distroptions.Rd
   branches/distr-2.0/pkg/distr/man/plot-methods.Rd
   branches/distr-2.0/pkg/distrDoc/inst/doc/distr.Rnw
   branches/distr-2.0/pkg/distrMod/man/distrModOptions.Rd
Log:
--------------
enhanced plot-methods
--------------
+withSweave ro be looked up in global option
+for LebDecDistribution: now also acPart and discretePart are plotted
+new argument to override mfrow=(1,3) resp (1,2) setting 

--------------
enhanced vignette 
--------------
+with new combined Sweave + lstlisting style

+new aliases for distrModoptions.Rd

Modified: branches/distr-2.0/pkg/distr/R/0distrOptions.R
===================================================================
--- branches/distr-2.0/pkg/distr/R/0distrOptions.R	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/R/0distrOptions.R	2008-08-12 00:31:05 UTC (rev 259)
@@ -10,7 +10,8 @@
                       ## new Items from 2.0:
                       withgaps = TRUE,
                       simplifyD = TRUE,
-                      DistrCollapse = TRUE
+                      DistrCollapse = TRUE,
+                      withSweave = FALSE
                       )
 distroptions <- function(...) {
   if (nargs() == 0) return(.distroptions)

Modified: branches/distr-2.0/pkg/distr/R/plot-methods.R
===================================================================
--- branches/distr-2.0/pkg/distr/R/plot-methods.R	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/R/plot-methods.R	2008-08-12 00:31:05 UTC (rev 259)
@@ -1,7 +1,7 @@
 # -------- AbscontDistribution ---------- #
 
 setMethod("plot", "AbscontDistribution",
-   function(x, y = NULL, width = 10, height = 5.5, withSweave = FALSE,
+   function(x, y = NULL, width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
             xlim = NULL, ylim = NULL, ngrid = 1000, verticals = TRUE,
             do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE, 
             bmar = par("mar")[1], tmar = par("mar")[3], ..., 
@@ -9,7 +9,7 @@
             cex.sub = par("cex.sub"), col.points = par("col"), 
             col.vert = par("col"), col.main = par("col.main"), 
             col.inner = par("col.main"), col.sub = par("col.sub"), 
-            cex.points = 2.0, pch.u = 21, pch.a = 16){
+            cex.points = 2.0, pch.u = 21, pch.a = 16, mfColRow = TRUE){
 
      xc <- match.call(call = sys.call(sys.parent(1)))$x
      ### manipulating the ... - argument
@@ -107,7 +107,10 @@
              if (missing(bmar)) bmar <- 6 
      }
      
-     opar <- par(mfrow = c(1,3), mar = c(bmar,omar[2],tmar,omar[4]))
+     if(mfColRow)
+         opar <- par(mfrow = c(1,3), mar = c(bmar,omar[2],tmar,omar[4]))
+     else
+         opar <- par(mar = c(bmar,omar[2],tmar,omar[4]))
      
      if(is.logical(inner)){     
         inner.d <- if (inner) 
@@ -255,7 +258,7 @@
 # -------- DiscreteDistribution -------- #
 
 setMethod("plot", "DiscreteDistribution",
-    function(x, y = NULL, width = 10, height = 5.5, withSweave = FALSE, 
+    function(x, y = NULL, width = 10, height = 5.5, withSweave = getdistrOption("withSweave"), 
              xlim = NULL, ylim = NULL, verticals = TRUE, do.points = TRUE, 
              main = FALSE, inner = TRUE, sub = FALSE,
              bmar = par("mar")[1], tmar = par("mar")[3], ..., 
@@ -264,7 +267,7 @@
              col.hor = par("col"), col.vert = par("col"), 
              col.main = par("col.main"), col.inner = par("col.main"), 
              col.sub = par("col.sub"),  cex.points = 2.0, 
-             pch.u = 21, pch.a = 16){
+             pch.u = 21, pch.a = 16, mfColRow = TRUE){
 
       xc <- match.call(call = sys.call(sys.parent(1)))$x
       ### manipulating the ... - argument
@@ -366,7 +369,10 @@
              if (missing(bmar)) bmar <- 6 
      }
      
-     opar <- par(mfrow = c(1,3), mar = c(bmar,omar[2],tmar,omar[4]))
+     if(mfColRow)
+        opar <- par(mfrow = c(1,3), mar = c(bmar,omar[2],tmar,omar[4]))
+     else 
+        opar <- par(mar = c(bmar,omar[2],tmar,omar[4]))
      
      if(is.logical(inner)){     
         inner.d <- if (inner) 

Modified: branches/distr-2.0/pkg/distr/R/plot-methods_LebDec.R
===================================================================
--- branches/distr-2.0/pkg/distr/R/plot-methods_LebDec.R	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/R/plot-methods_LebDec.R	2008-08-12 00:31:05 UTC (rev 259)
@@ -1,7 +1,7 @@
 ############################ plot #######################
 
 setMethod("plot", "AffLinUnivarLebDecDistribution",
-    function(x, y = NULL, width = 10, height = 5.5, withSweave = FALSE,
+    function(x, y = NULL, width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
              xlim = NULL, ylim = NULL, ngrid = 1000,
              verticals = TRUE, do.points = TRUE,
              main = FALSE, inner = TRUE, sub = FALSE,
@@ -11,7 +11,7 @@
              col.hor = par("col"), col.vert = par("col"),
              col.main = par("col.main"), col.inner = par("col.main"),
              col.sub = par("col.sub"),  cex.points = 2.0,
-             pch.u = 21, pch.a = 16){
+             pch.u = 21, pch.a = 16, mfColRow = TRUE){
 
       mc <- match.call(call = sys.call(sys.parent(1)), expand.dots = FALSE)[-1]
       mc$x <- NULL
@@ -22,17 +22,17 @@
 })
 
 setMethod("plot", "UnivarLebDecDistribution",
-    function(x, y = NULL, width = 10, height = 5.5, withSweave = FALSE,
+    function(x, y = NULL, width = 10, height = 14.5, withSweave = getdistrOption("withSweave"),
              xlim = NULL, ylim = NULL, ngrid = 1000,
              verticals = TRUE, do.points = TRUE,
              main = FALSE, inner = TRUE, sub = FALSE,
              bmar = par("mar")[1], tmar = par("mar")[3], ...,
-             cex.main = par("cex.main"), cex.inner = 1.2,
+             cex.main = par("cex.main"), cex.inner = 0.9,
              cex.sub = par("cex.sub"), col.points = par("col"),
              col.hor = par("col"), col.vert = par("col"),
              col.main = par("col.main"), col.inner = par("col.main"),
              col.sub = par("col.sub"),  cex.points = 2.0,
-             pch.u = 21, pch.a = 16){
+             pch.u = 21, pch.a = 16, mfColRow = TRUE){
 
 
       mc <- match.call(call = sys.call(sys.parent(1)), expand.dots = FALSE)[-1]
@@ -151,7 +151,12 @@
              if (missing(bmar)) bmar <- 6
      }
 
-     opar <- par(mfrow = c(1,2), mar = c(bmar,omar[2],tmar,omar[4]))
+     if(mfColRow){
+        opar <- par("mfrow", mar = c(bmar,omar[2],tmar,omar[4]))
+        layout(matrix(c(1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,7,8,8), byrow=TRUE, 
+               nrow=3))
+     }else 
+        opar <- par(mar = c(bmar,omar[2],tmar,omar[4]))
 
      if(is.logical(inner)){
         inner.p <- if (inner)
@@ -323,6 +328,27 @@
      if (subL)
          mtext(text = sub, side = 1, cex = cex.sub, adj = .5,
                outer = TRUE, line = -1.6, col = col.sub)
+               
+     mc.ac <- mc
+     if(!is.logical(inner)) mc.ac$inner <- inner[3:5] 
+     mc.ac$mfColRow <- FALSE
+     mc.ac$main <- FALSE
+     mc.ac$sub <- FALSE
+     mc.ac$x <- NULL 
+     mc.ac$withSweave <- TRUE 
+     if(is.null(mc.ac$cex.inner))  mc.ac$cex.inner <- 0.9
+     do.call(plot, c(list(acPart(x)),mc.ac))
+
+     mc.di <- mc
+     if(!is.logical(inner)) mc.di$inner <- inner[6:8] 
+     mc.di$mfColRow <- FALSE
+     mc.di$main <- FALSE
+     mc.di$sub <- FALSE
+     mc.di$x <- NULL
+     mc.di$withSweave <- TRUE 
+     if(is.null(mc.di$cex.inner))  mc.di$cex.inner <- 0.9
+     do.call(plot, c(list(discretePart(x)),mc.di))
+     
      par(opar)
    }
    )

Modified: branches/distr-2.0/pkg/distr/chm/00Index.html
===================================================================
--- branches/distr-2.0/pkg/distr/chm/00Index.html	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/chm/00Index.html	2008-08-12 00:31:05 UTC (rev 259)
@@ -1566,6 +1566,10 @@
 <td>Methods for Function width in Package &lsquo;distr&rsquo; </td></tr>
 <tr><td width="25%"><a href="width-methods.html">width&lt;--methods</a></td>
 <td>Methods for Function width in Package &lsquo;distr&rsquo; </td></tr>
+<tr><td width="25%"><a href="distroptions.html">withgaps</a></td>
+<td>functions to change the global variables of the package &lsquo;distr&rsquo; </td></tr>
+<tr><td width="25%"><a href="distroptions.html">withSweave</a></td>
+<td>functions to change the global variables of the package &lsquo;distr&rsquo; </td></tr>
 </table>
 
 <h2><a name="misc">-- misc --</a></h2>

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

Modified: branches/distr-2.0/pkg/distr/chm/Distr.toc
===================================================================
--- branches/distr-2.0/pkg/distr/chm/Distr.toc	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/chm/Distr.toc	2008-08-12 00:31:05 UTC (rev 259)
@@ -3202,6 +3202,14 @@
 <param name="Local" value="width-methods.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="withgaps">
+<param name="Local" value="distroptions.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
+<param name="Name" value="withSweave">
+<param name="Local" value="distroptions.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="^,AcDcLcDistribution,AcDcLcDistribution-method">
 <param name="Local" value="operators-methods.html">
 </OBJECT>

Modified: branches/distr-2.0/pkg/distr/chm/distroptions.html
===================================================================
--- branches/distr-2.0/pkg/distr/chm/distroptions.html	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/chm/distroptions.html	2008-08-12 00:31:05 UTC (rev 259)
@@ -17,6 +17,8 @@
 <param name="keyword" value="R:   RtoDPQ.e">
 <param name="keyword" value="R:   WarningArith">
 <param name="keyword" value="R:   WarningSim">
+<param name="keyword" value="R:   withSweave">
+<param name="keyword" value="R:   withgaps">
 <param name="keyword" value=" functions to change the global variables of the package &lsquo;distr&rsquo;">
 </object>
 
@@ -87,6 +89,14 @@
 arithmetics operating on distributions, when the corresponding distribution to be plotted/shown is obtained by such an operation;
 keep in mind that arithmetics in fact operate on random variables distributed according to the given distributions and <B>not</B>
 on corresponding cdf's or densities; default value: <code>TRUE</code></dd>
+<dt><code>withSweave</code></dt><dd>is code run in Sweave (then no new graphic devices are opened), 
+default value: <code>FALSE</code></dd>
+<dt><code>withgaps</code></dt><dd>controls whether in the return value of arithmetic
+operations the slot <code>gaps</code> of an the <code>AbscontDistribution</code> part
+is filled automatically based on empirical evaluations via  <code>setgaps</code>
+&mdash;default <code>TRUE</code></dd>
+<dt><code>simplifyD</code></dt><dd>controls whether in the return value of arithmetic
+operations there is a call to <code>simplifyD</code> or not &mdash;default <code>TRUE</code></dd>
 </dl>
 
 <h3>Author(s)</h3>

Modified: branches/distr-2.0/pkg/distr/chm/plot-methods.html
===================================================================
--- branches/distr-2.0/pkg/distr/chm/plot-methods.html	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/chm/plot-methods.html	2008-08-12 00:31:05 UTC (rev 259)
@@ -31,41 +31,41 @@
 <pre>plot(x,y, ...)
 ## S4 method for signature 'AbscontDistribution':
 plot(x, y = NULL, width = 10, height = 5.5,
-     withSweave = FALSE, xlim = NULL, ylim = NULL, ngrid = 1000,
+     withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
      verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE,
      sub = FALSE, bmar = par("mar")[1], tmar = par("mar")[3], ...,
      cex.main = par("cex.main"), cex.inner = 1.2, cex.sub = par("cex.sub"), 
      col.points = par("col"), col.vert = par("col"), col.main = par("col.main"),  
      col.inner = par("col.main"), col.sub = par("col.sub"), cex.points = 2.0, 
-     pch.u = 21, pch.a = 16)
+     pch.u = 21, pch.a = 16, mfColRow = TRUE)
 ## S4 method for signature 'DiscreteDistribution':
 plot(x, y = NULL, width = 10, height = 5.5,
-     withSweave = FALSE, xlim = NULL, ylim = NULL, verticals = TRUE,
+     withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, verticals = TRUE,
      do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE, 
      bmar = par("mar")[1], tmar = par("mar")[3], ..., 
      cex.main = par("cex.main"), cex.inner = 1.2, cex.sub = par("cex.sub"), 
      col.points = par("col"), col.hor = par("col"), col.vert = par("col"), 
      col.main = par("col.main"), col.inner = par("col.main"), 
-     col.sub = par("col.sub"),  cex.points = 2.0, pch.u = 21, pch.a = 16)
+     col.sub = par("col.sub"),  cex.points = 2.0, pch.u = 21, pch.a = 16, mfColRow = TRUE)
 ## S4 method for signature
 ##   'AffLinUnivarLebDecDistribution':
 plot(x, y = NULL, width = 10, 
-     height = 5.5, withSweave = FALSE, xlim = NULL, ylim = NULL, ngrid = 1000,
+     height = 5.5, withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
      verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE,
      bmar = par("mar")[1], tmar = par("mar")[3], ..., cex.main = par("cex.main"), 
      cex.inner = 1.2, cex.sub = par("cex.sub"), col.points = par("col"),
      col.hor = par("col"), col.vert = par("col"), col.main = par("col.main"), 
      col.inner = par("col.main"), col.sub = par("col.sub"),  cex.points = 2.0,
-     pch.u = 21, pch.a = 16)
+     pch.u = 21, pch.a = 16, mfColRow = TRUE)
 ## S4 method for signature 'UnivarLebDecDistribution':
 plot(x, y = NULL, width = 10, 
-     height = 5.5, withSweave = FALSE, xlim = NULL, ylim = NULL, ngrid = 1000,
+     height = 5.5, withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
      verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE,
      bmar = par("mar")[1], tmar = par("mar")[3], ..., cex.main = par("cex.main"), 
      cex.inner = 1.2, cex.sub = par("cex.sub"), col.points = par("col"),
      col.hor = par("col"), col.vert = par("col"), col.main = par("col.main"), 
      col.inner = par("col.main"), col.sub = par("col.sub"),  cex.points = 2.0,
-     pch.u = 21, pch.a = 16)
+     pch.u = 21, pch.a = 16, mfColRow = TRUE)
 ## S4 method for signature 'DistrList':
 plot(x, y = NULL, ...)
 </pre>
@@ -184,6 +184,9 @@
 <td>
 character or integer code; plotting characters or symbols for
 attained value; see <code><a onclick="findlink('stats', 'points.html')" style="text-decoration: underline; color: blue; cursor: hand">points</a></code></td></tr>
+<tr valign="top"><td><code>mfColRow</code></td>
+<td>
+shall default partition in panels be used &mdash; defaults to <code>TRUE</code></td></tr>
 <tr valign="top"><td><code>...</code></td>
 <td>
 addtional arguments for <code>plot</code> &mdash; see 
@@ -197,8 +200,11 @@
 <dl>
 <dt>plot</dt><dd><code>signature(object = "AffLinUnivarLebDecDistribution")</code>: plots  
 cumulative distribution function and the quantile function </dd>
-<dt>plot</dt><dd><code>signature(object = "UnivarLebDecDistribution")</code>: plots  
-cumulative distribution function and the quantile function </dd>
+<dt>plot</dt><dd><code>signature(object = "UnivarLebDecDistribution")</code>: plots a set of
+eight plots: in the first row,  it plots the 
+cumulative distribution function and the quantile function; in the second
+row the absolutely continuous part (with density, cdf and quantile fct.),
+and in the last row the discrete part (with prob.fct., cdf and quantile fct.). </dd>
 <dt>plot</dt><dd><code>signature(object = "AbscontDistribution")</code>: plots density, 
 cumulative distribution function and the quantile function </dd>
 <dt>plot</dt><dd><code>signature(object = "DiscreteDistribution")</code>: plots probability 

Modified: branches/distr-2.0/pkg/distr/man/distroptions.Rd
===================================================================
--- branches/distr-2.0/pkg/distr/man/distroptions.Rd	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/man/distroptions.Rd	2008-08-12 00:31:05 UTC (rev 259)
@@ -11,6 +11,9 @@
 \alias{RtoDPQ.e}
 \alias{WarningArith}
 \alias{WarningSim}
+\alias{withSweave}
+%\alias{simplifyD}
+\alias{withgaps}
 
 \title{
   functions to change the global variables of the package `distr'
@@ -60,6 +63,14 @@
 arithmetics operating on distributions, when the corresponding distribution to be plotted/shown is obtained by such an operation;
 keep in mind that arithmetics in fact operate on random variables distributed according to the given distributions and \bold{not}
 on corresponding cdf's or densities; default value: \code{TRUE}}
+\item{\code{withSweave}}{is code run in Sweave (then no new graphic devices are opened), 
+                         default value: \code{FALSE}}
+  \item{\code{withgaps}}{controls whether in the return value of arithmetic
+  operations the slot \code{gaps} of an the \code{AbscontDistribution} part
+  is filled automatically based on empirical evaluations via  \code{setgaps}
+   ---default \code{TRUE}}
+  \item{\code{simplifyD}}{ controls whether in the return value of arithmetic
+  operations there is a call to \code{simplifyD} or not ---default \code{TRUE}}
 }
 } 
 \examples{

Modified: branches/distr-2.0/pkg/distr/man/plot-methods.Rd
===================================================================
--- branches/distr-2.0/pkg/distr/man/plot-methods.Rd	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distr/man/plot-methods.Rd	2008-08-12 00:31:05 UTC (rev 259)
@@ -11,37 +11,37 @@
 \description{plot-methods}
 \usage{plot(x,y, ...)
 \S4method{plot}{AbscontDistribution}(x, y = NULL, width = 10, height = 5.5,
-     withSweave = FALSE, xlim = NULL, ylim = NULL, ngrid = 1000,
+     withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
      verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE,
      sub = FALSE, bmar = par("mar")[1], tmar = par("mar")[3], ...,
      cex.main = par("cex.main"), cex.inner = 1.2, cex.sub = par("cex.sub"), 
      col.points = par("col"), col.vert = par("col"), col.main = par("col.main"),  
      col.inner = par("col.main"), col.sub = par("col.sub"), cex.points = 2.0, 
-     pch.u = 21, pch.a = 16)
+     pch.u = 21, pch.a = 16, mfColRow = TRUE)
 \S4method{plot}{DiscreteDistribution}(x, y = NULL, width = 10, height = 5.5,
-     withSweave = FALSE, xlim = NULL, ylim = NULL, verticals = TRUE,
+     withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, verticals = TRUE,
      do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE, 
      bmar = par("mar")[1], tmar = par("mar")[3], ..., 
      cex.main = par("cex.main"), cex.inner = 1.2, cex.sub = par("cex.sub"), 
      col.points = par("col"), col.hor = par("col"), col.vert = par("col"), 
      col.main = par("col.main"), col.inner = par("col.main"), 
-     col.sub = par("col.sub"),  cex.points = 2.0, pch.u = 21, pch.a = 16)
+     col.sub = par("col.sub"),  cex.points = 2.0, pch.u = 21, pch.a = 16, mfColRow = TRUE)
 \S4method{plot}{AffLinUnivarLebDecDistribution}(x, y = NULL, width = 10, 
-     height = 5.5, withSweave = FALSE, xlim = NULL, ylim = NULL, ngrid = 1000,
+     height = 5.5, withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
      verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE,
      bmar = par("mar")[1], tmar = par("mar")[3], ..., cex.main = par("cex.main"), 
      cex.inner = 1.2, cex.sub = par("cex.sub"), col.points = par("col"),
      col.hor = par("col"), col.vert = par("col"), col.main = par("col.main"), 
      col.inner = par("col.main"), col.sub = par("col.sub"),  cex.points = 2.0,
-     pch.u = 21, pch.a = 16)
+     pch.u = 21, pch.a = 16, mfColRow = TRUE)
 \S4method{plot}{UnivarLebDecDistribution}(x, y = NULL, width = 10, 
-     height = 5.5, withSweave = FALSE, xlim = NULL, ylim = NULL, ngrid = 1000,
+     height = 5.5, withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
      verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE,
      bmar = par("mar")[1], tmar = par("mar")[3], ..., cex.main = par("cex.main"), 
      cex.inner = 1.2, cex.sub = par("cex.sub"), col.points = par("col"),
      col.hor = par("col"), col.vert = par("col"), col.main = par("col.main"), 
      col.inner = par("col.main"), col.sub = par("col.sub"),  cex.points = 2.0,
-     pch.u = 21, pch.a = 16)
+     pch.u = 21, pch.a = 16, mfColRow = TRUE)
 \S4method{plot}{DistrList}(x, y = NULL, ...)
 }
 \arguments{
@@ -101,6 +101,7 @@
                unattained value; see \code{\link[stats]{points}}}              
   \item{pch.a}{character or integer code; plotting characters or symbols for
                attained value; see \code{\link[stats]{points}}}              
+  \item{mfColRow}{shall default partition in panels be used --- defaults to \code{TRUE}}
   \item{\dots}{addtional arguments for \code{plot} --- see 
                \code{\link[stats]{plot}}, 
                \code{\link[stats]{plot.default}}, 
@@ -110,8 +111,11 @@
 \describe{
 \item{plot}{\code{signature(object = "AffLinUnivarLebDecDistribution")}: plots  
    cumulative distribution function and the quantile function }
-\item{plot}{\code{signature(object = "UnivarLebDecDistribution")}: plots  
-   cumulative distribution function and the quantile function }
+\item{plot}{\code{signature(object = "UnivarLebDecDistribution")}: plots a set of
+  eight plots: in the first row,  it plots the 
+   cumulative distribution function and the quantile function; in the second
+   row the absolutely continuous part (with density, cdf and quantile fct.),
+   and in the last row the discrete part (with prob.fct., cdf and quantile fct.). }
 \item{plot}{\code{signature(object = "AbscontDistribution")}: plots density, 
    cumulative distribution function and the quantile function }
 \item{plot}{\code{signature(object = "DiscreteDistribution")}: plots probability 

Modified: branches/distr-2.0/pkg/distrDoc/inst/doc/distr.Rnw
===================================================================
--- branches/distr-2.0/pkg/distrDoc/inst/doc/distr.Rnw	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distrDoc/inst/doc/distr.Rnw	2008-08-12 00:31:05 UTC (rev 259)
@@ -19,6 +19,21 @@
 pagecolor=darkblue,raiselinks,plainpages,pdftex]{hyperref}
 %
 \usepackage{Sweave}
+\RequirePackage{color}
+\RequirePackage{listings}  
+%
+\lstset{fancyvrb=true,language=R,basicstyle=\color{Rcolor}\small,
+        commentstyle=\color{Rcomment}\ttfamily\itshape,
+        literate={<-}{{$\leftarrow$}}2,
+        morekeywords=[2]{Norm,Pois,lambda,p,d,r,distroptions}}
+\newcommand{\ttR}[1]{{\color{Rcolor}\tt #1\color{normal}}}
+\definecolor{Rcolor}{rgb}{0,0.5,0.5}
+\definecolor{Rout}{rgb}{0.461,0.039,0.102}
+\definecolor{Rcomment}{rgb}{0.101,0.043,0.432}
+%
+\DefineVerbatimEnvironment{Sinput}{Verbatim}{formatcom=\color{Rcolor}\lstset{fancyvrb=true}}
+\DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom=\color{Rout}\lstset{fancyvrb=false}}
+\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl,formatcom=\color{Rcolor}\lstset{fancyvrb=true}}
 \markboth{\sl Packages ``{\tt distr}'', ``{\tt distrSim}'', ``{\tt distrTEst}'', 
 ``{\tt distrEx}'', ``{\tt distrTeach}'', ``{\tt distrMod}''}%
 {\sl Packages ``{\tt distr}'', ``{\tt distrSim}'', ``{\tt distrTEst}'',  
@@ -149,13 +164,18 @@
 function $f\colon \Reals^2 \to \Reals$ which is already realized as a function 
 in {\sf R}.\\
 This is possible with package \pkg{distr}. As an example, try
+<<echo=false,results=hide>>=
+## preparation: set option withSweave to true
+require(distr)
+distroptions(withSweave = TRUE)
+@
 <<exam1, eval = TRUE, fig = TRUE>>=
-library(distr)
+require(distr)
 N <- Norm(mean = 2, sd = 1.3)
 P <- Pois(lambda = 1.2)
 Z <- 2*N + 3 + P
 Z
-plot(Z, withSweave = TRUE)
+plot(Z)
 p(Z)(0.4)
 q(Z)(0.3)
 Zs <- r(Z)(50)
@@ -1001,22 +1021,22 @@
 <<arith2v1, eval = TRUE, fig = TRUE>>=
   A1 <- Norm(); A2 <- Unif()
   A1A2 <- A1*A2
-  plot(A1A2, withSweave = TRUE)
+  plot(A1A2)
 @
 <<arith2v2, eval = TRUE, fig = TRUE>>=
   A12 <- 1/(A2 + .3)
-  plot(A12, withSweave = TRUE) 
+  plot(A12) 
 @
 <<arith2v3, eval = TRUE, fig = TRUE>>=
   B <- Binom(5,.2)+1
   A1B <- A1^B
-  plot(A1B, xlim=c(-3,3), withSweave = TRUE)
+  plot(A1B, xlim=c(-3,3))
 @
 <<arith2V4, fig = TRUE>>=
-  plot(1.2^A1, withSweave = TRUE)
+  plot(1.2^A1)
 @
 <<arith2v5, fig = TRUE>>=
-  plot(B^A1, withSweave = TRUE)
+  plot(B^A1)
 @
 %
 \subsection{Truncation, Pairwise Minimum/Maximum, Huberization}\label{TruncMin}
@@ -1028,23 +1048,23 @@
 Now these illustrations have moved into the package itself:
 <<Hub, eval = TRUE, fig = TRUE>>=
 H <- Huberize(Norm(),lower=-1,upper=2)
-plot(H, withSweave = TRUE)
+plot(H)
 @
 <<Trun, eval = TRUE, fig = TRUE>>=
 T <- Truncate(Norm(),lower=-1,upper=2)
-plot(T, withSweave = TRUE)
+plot(T)
 @
 <<Min1, eval = TRUE, fig = TRUE>>=
 M1 <- Maximum(Unif(0,1), Minimum(Unif(0,1), Unif(0,1)))
-plot(M1, withSweave = TRUE)
+plot(M1)
 @
 <<Min2, eval = TRUE, fig = TRUE>>=
 M2 <- Minimum(Exp(4),4)
-plot(M2, withSweave = TRUE)
+plot(M2)
 @
 <<Min3, eval = TRUE, fig = TRUE>>=
 M3 <- Minimum(Norm(2,2), Pois(3))
-plot(M3, withSweave = TRUE)
+plot(M3)
 @
 %
 \subsection{Overloaded generic functions}
@@ -1120,7 +1140,7 @@
 
 \begin{figure}[p]
 <<plotex1, eval = TRUE, fig = TRUE, width=8.0,height=4.5>>=
-plot(Binom(size = 4, prob = 0.3), withSweave = TRUE)
+plot(Binom(size = 4, prob = 0.3))
 @
 \end{figure}
 \begin{figure}[p]
@@ -1133,7 +1153,7 @@
 \begin{figure}[p]
 <<plotex3, eval = TRUE, fig = TRUE, width=8.0,height=4.5>>=
 plot(Binom(size = 4, prob = 0.3), main = TRUE, inner = FALSE, cex.main = 1.6,
-     tmar = 6, withSweave = TRUE)
+     tmar = 6)
 @
 \end{figure}
 
@@ -1162,7 +1182,7 @@
 
 \begin{figure}[p]
 <<plotex7, eval = TRUE, fig = TRUE, width=8.0,height=4.5>>=
-plot(Chisq(), log = "xy", ngrid = 100, withSweave = TRUE)
+plot(Chisq(), log = "xy", ngrid = 100)
 @
 \end{figure}
 
@@ -1179,7 +1199,7 @@
      inner = list(expression(paste(lambda, "-density of \%C(\%P)")), "CDF",
                   "Pseudo-inverse with param's \%N"),
      sub = "this plot was correctly generated on \%D",
-     cex.inner = 0.9, cex.sub = 0.8, withSweave = TRUE)
+     cex.inner = 0.9, cex.sub = 0.8)
 @
 \end{figure}
 
@@ -1187,7 +1207,7 @@
 <<plotex10, eval = TRUE, fig = TRUE, width=8.0,height=4.5>>=
 Ch <- Chisq(); setgaps(Ch, exactq = 3)
 plot(Ch, cex = 1.2, pch.u = 20, pch.a = 10, col.points = "green", 
-     col.vert = "red", withSweave = TRUE)
+     col.vert = "red")
 @
 \end{figure}
 
@@ -1781,6 +1801,8 @@
   \item \code{DistrCollapse}: logical; in convolving discrete distributions, 
   shall support points with distance smaller than \code{DistrResolution} be 
   collapsed; default value:  \code{TRUE}
+   \item \code{withSweave}: logical; is code run in Sweave (then no new graphic devices are opened);
+                         default value: \code{FALSE}
 \end{itemize}
 All current options may be inspected by \code{distroptions()}  and modified by
  \linebreak[4] \code{distroptions("<options-name>"=<value>)}.\\
@@ -2485,7 +2507,7 @@
 N <- Norm()
 B <- Binom()
 N at d <- B at d
-plot(N, lwd = 3, withSweave = TRUE) 
+plot(N, lwd = 3) 
 @
 \subsection{A simulation example}\label{simex}
 {\bf needs packages \pkg{distrSim}/\pkg{distrTEst}}\\[2ex]

Modified: branches/distr-2.0/pkg/distrMod/man/distrModOptions.Rd
===================================================================
--- branches/distr-2.0/pkg/distrMod/man/distrModOptions.Rd	2008-08-11 00:30:51 UTC (rev 258)
+++ branches/distr-2.0/pkg/distrMod/man/distrModOptions.Rd	2008-08-12 00:31:05 UTC (rev 259)
@@ -2,6 +2,8 @@
 \alias{distrModOptions}
 \alias{getdistrModOption}
 \alias{distrModoptions}
+\alias{show.details}
+\alias{use.generalized.inverse.by.default}
 
 \title{Function to change the global variables of the package `distrMod' }
 \description{With \code{distrModOptions} you can inspect and change 



More information about the Distr-commits mailing list