[Distr-commits] r594 - in branches/distr-2.2/pkg: distr/R distr/inst/doc distr/man distrMod/R distrMod/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 5 23:53:00 CEST 2009


Author: ruckdeschel
Date: 2009-10-05 23:53:00 +0200 (Mon, 05 Oct 2009)
New Revision: 594

Modified:
   branches/distr-2.2/pkg/distr/R/qqplot.R
   branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf
   branches/distr-2.2/pkg/distr/man/qqplot.Rd
   branches/distr-2.2/pkg/distrMod/R/qqplot.R
   branches/distr-2.2/pkg/distrMod/man/qqplot.Rd
Log:
qqplot methods now have the same window-opening policy as plot-methods (i.e. width and height arguments, argument withSweave
 [if (withSweave) devNew() is called], and mfColRow)

Modified: branches/distr-2.2/pkg/distr/R/qqplot.R
===================================================================
--- branches/distr-2.2/pkg/distr/R/qqplot.R	2009-10-05 20:54:36 UTC (rev 593)
+++ branches/distr-2.2/pkg/distr/R/qqplot.R	2009-10-05 21:53:00 UTC (rev 594)
@@ -8,6 +8,8 @@
     withConf.pw  = withConf,  withConf.sim = withConf,
     plot.it = TRUE, xlab = deparse(substitute(x)),
     ylab = deparse(substitute(y)), ...,
+    width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
+    mfColRow=TRUE,
     col.IdL = "red", lty.IdL = 2, lwd.IdL = 2,
     alpha.CI = .95, exact.pCI = (n<100), exact.sCI = (n<100), nosym.pCI = FALSE,
     col.pCI = "orange", lty.pCI = 3, lwd.pCI = 2, pch.pCI = par("pch"), cex.pCI = par("cex"),
@@ -59,6 +61,13 @@
     mcl$cex <- .makeLenAndOrder(cex.pch,ord.x)
     mcl$col <- .makeLenAndOrder(col.pch,ord.x)
 
+    if (!withSweave){
+           devNew(width = width, height = height)
+    }
+    opar <- par("mfrow")
+    on.exit(do.call(par, list(mfrow=opar)))
+    if(mfColRow) opar1 <- par(mfrow = c(1,1))
+
     ret <- do.call(stats::qqplot, args=mcl)
 
     if(withIdLine&& plot.it){

Modified: branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf
===================================================================
--- branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf	2009-10-05 20:54:36 UTC (rev 593)
+++ branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf	2009-10-05 21:53:00 UTC (rev 594)
@@ -2,8 +2,8 @@
 %âãÏÓ\r
 1 0 obj
 <<
-/CreationDate (D:20091005225424)
-/ModDate (D:20091005225424)
+/CreationDate (D:20091005234212)
+/ModDate (D:20091005234212)
 /Title (R Graphics Output)
 /Producer (R 2.10.0)
 /Creator (R)
@@ -282,7 +282,7 @@
 65.85 76.68 l
 65.96 77.03 l
 66.06 77.39 l
-66.16 77.75 l
+66.16 77.76 l
 66.26 78.13 l
 66.36 78.51 l
 66.46 78.90 l
@@ -315,7 +315,7 @@
 69.19 93.26 l
 69.29 93.95 l
 69.39 94.66 l
-69.49 95.37 l
+69.49 95.38 l
 69.59 96.11 l
 69.70 96.85 l
 69.80 97.61 l
@@ -351,7 +351,7 @@
 72.83 127.42 l
 72.93 128.67 l
 73.03 129.93 l
-73.13 131.21 l
+73.13 131.22 l
 73.23 132.51 l
 73.34 133.83 l
 73.44 135.17 l
@@ -359,7 +359,7 @@
 73.64 137.89 l
 73.74 139.28 l
 73.84 140.68 l
-73.94 142.10 l
+73.94 142.11 l
 74.04 143.55 l
 74.14 145.01 l
 74.25 146.48 l
@@ -375,21 +375,21 @@
 75.26 162.23 l
 75.36 163.91 l
 75.46 165.60 l
-75.56 167.31 l
+75.56 167.30 l
 75.66 169.03 l
 75.76 170.77 l
 75.86 172.53 l
 75.96 174.31 l
-76.06 176.11 l
+76.06 176.10 l
 76.17 177.92 l
-76.27 179.75 l
+76.27 179.74 l
 76.37 181.59 l
 76.47 183.45 l
 76.57 185.33 l
-76.67 187.23 l
+76.67 187.22 l
 76.77 189.14 l
 76.87 191.06 l
-76.97 193.00 l
+76.97 193.01 l
 77.08 194.96 l
 77.18 196.94 l
 77.28 198.93 l
@@ -407,16 +407,16 @@
 78.49 223.93 l
 78.59 226.10 l
 78.69 228.28 l
-78.79 230.48 l
+78.79 230.47 l
 78.90 232.68 l
 79.00 234.90 l
 79.10 237.12 l
 79.20 239.36 l
 79.30 241.61 l
 79.40 243.87 l
-79.50 246.14 l
+79.50 246.13 l
 79.60 248.41 l
-79.70 250.70 l
+79.70 250.69 l
 79.81 252.99 l
 79.91 255.29 l
 80.01 257.60 l
@@ -431,7 +431,7 @@
 80.92 278.66 l
 81.02 281.02 l
 81.12 283.39 l
-81.22 285.76 l
+81.22 285.75 l
 81.32 288.13 l
 81.42 290.50 l
 81.52 292.87 l
@@ -448,18 +448,18 @@
 82.64 318.92 l
 82.74 321.26 l
 82.84 323.61 l
-82.94 325.95 l
+82.94 325.94 l
 83.04 328.28 l
 83.14 330.60 l
 83.24 332.92 l
 83.34 335.23 l
-83.44 337.53 l
+83.44 337.52 l
 83.55 339.82 l
 83.65 342.10 l
 83.75 344.37 l
 83.85 346.63 l
 83.95 348.88 l
-84.05 351.11 l
+84.05 351.12 l
 84.15 353.34 l
 84.25 355.55 l
 84.35 357.75 l
@@ -574,7 +574,7 @@
 95.37 426.08 l
 95.48 424.79 l
 95.58 423.47 l
-95.68 422.12 l
+95.68 422.11 l
 95.78 420.73 l
 95.88 419.32 l
 95.98 417.88 l
@@ -609,7 +609,7 @@
 98.91 365.56 l
 99.01 363.46 l
 99.11 361.36 l
-99.22 359.23 l
+99.22 359.24 l
 99.32 357.10 l
 99.42 354.96 l
 99.52 352.80 l
@@ -623,45 +623,45 @@
 100.33 335.17 l
 100.43 332.93 l
 100.53 330.68 l
-100.63 328.42 l
-100.73 326.16 l
+100.63 328.43 l
+100.73 326.17 l
 100.83 323.90 l
 100.93 321.63 l
 101.04 319.35 l
 101.14 317.07 l
 101.24 314.79 l
 101.34 312.50 l
-101.44 310.22 l
-101.54 307.92 l
+101.44 310.21 l
+101.54 307.93 l
 101.64 305.63 l
 101.74 303.34 l
 101.84 301.05 l
-101.95 298.76 l
+101.95 298.75 l
 102.05 296.46 l
 102.15 294.17 l
 102.25 291.88 l
 102.35 289.59 l
 102.45 287.30 l
 102.55 285.02 l
-102.65 282.73 l
+102.65 282.74 l
 102.75 280.46 l
 102.86 278.18 l
 102.96 275.91 l
 103.06 273.64 l
 103.16 271.38 l
 103.26 269.12 l
-103.36 266.87 l
+103.36 266.88 l
 103.46 264.63 l
 103.56 262.39 l
 103.66 260.16 l
 103.77 257.93 l
 103.87 255.72 l
 103.97 253.51 l
-104.07 251.31 l
+104.07 251.30 l
 104.17 249.11 l
 104.27 246.93 l
 104.37 244.75 l
-104.47 242.58 l
+104.47 242.59 l
 104.57 240.43 l
 104.68 238.28 l
 104.78 236.14 l
@@ -669,7 +669,7 @@
 104.98 231.90 l
 105.08 229.80 l
 105.18 227.71 l
-105.28 225.63 l
+105.28 225.62 l
 105.38 223.56 l
 105.48 221.50 l
 105.59 219.45 l
@@ -684,7 +684,7 @@
 106.49 201.63 l
 106.60 199.72 l
 106.70 197.82 l
-106.80 195.93 l
+106.80 195.94 l
 106.90 194.07 l
 107.00 192.21 l
 107.10 190.37 l
@@ -725,7 +725,7 @@
 110.64 136.00 l
 110.74 134.74 l
 110.84 133.50 l
-110.94 132.26 l
+110.94 132.27 l
 111.04 131.05 l
 111.15 129.85 l
 111.25 128.67 l
@@ -734,7 +734,7 @@
 111.55 125.21 l
 111.65 124.09 l
 111.75 122.99 l
-111.85 121.90 l
+111.85 121.89 l
 111.95 120.82 l
 112.06 119.76 l
 112.16 118.71 l
@@ -756,7 +756,7 @@
 113.77 103.94 l
 113.87 103.13 l
 113.98 102.34 l
-114.08 101.56 l
+114.08 101.55 l
 114.18 100.79 l
 114.28 100.03 l
 114.38 99.29 l
@@ -6712,4 +6712,152 @@
 475.33 414.79 l
 475.33 415.26 l
 475.33 415.72 l
-475.3
\ No newline at end of file
+475.34 416.19 l
+475.34 416.65 l
+475.34 417.11 l
+475.35 417.58 l
+475.35 418.04 l
+475.35 418.51 l
+475.35 418.97 l
+475.36 419.44 l
+475.36 419.90 l
+475.36 420.36 l
+475.36 420.83 l
+475.36 421.29 l
+475.37 421.76 l
+475.37 422.22 l
+475.37 422.68 l
+475.37 423.15 l
+475.37 423.61 l
+475.38 424.08 l
+475.38 424.54 l
+475.38 425.01 l
+475.38 425.47 l
+475.38 425.93 l
+475.38 426.40 l
+475.38 426.86 l
+475.39 427.33 l
+475.39 427.79 l
+475.39 428.25 l
+475.39 428.72 l
+475.39 429.18 l
+475.39 429.65 l
+475.39 430.11 l
+475.39 430.58 l
+475.39 431.04 l
+475.39 431.50 l
+475.40 431.97 l
+475.40 432.43 l
+475.40 432.90 l
+475.40 433.36 l
+475.40 433.82 l
+475.40 434.29 l
+475.40 434.75 l
+475.40 435.22 l
+475.40 435.68 l
+475.40 436.15 l
+475.40 436.61 l
+475.40 437.07 l
+475.40 437.54 l
+475.40 438.00 l
+475.40 438.47 l
+475.40 438.93 l
+475.40 439.39 l
+475.40 439.86 l
+475.41 440.32 l
+475.41 440.79 l
+475.41 441.25 l
+475.41 441.71 l
+475.41 442.18 l
+475.41 442.64 l
+475.41 443.11 l
+475.41 443.57 l
+475.41 444.04 l
+475.41 444.50 l
+475.41 444.96 l
+475.41 445.43 l
+475.41 445.89 l
+475.41 446.36 l
+475.41 446.82 l
+475.41 447.28 l
+475.41 447.75 l
+475.41 448.21 l
+475.41 448.68 l
+475.41 449.14 l
+475.41 449.61 l
+S
+Q
+endstream
+endobj
+13 0 obj
+50571
+endobj
+3 0 obj
+<<
+/Type /Pages
+/Kids [
+5 0 R
+8 0 R
+11 0 R
+]
+/Count 3
+/MediaBox [0 0 504 504]
+>>
+endobj
+4 0 obj
+<<
+/ProcSet [/PDF /Text]
+/Font << /F1 15 0 R /F2 16 0 R >>
+/ExtGState << >>
+>>
+endobj
+14 0 obj
+<<
+/Type /Encoding
+/BaseEncoding /WinAnsiEncoding
+/Differences [ 45/minus ]
+>>
+endobj
+15 0 obj
+<<
+/Type /Font
+/Subtype /Type1
+/Name /F1
+/BaseFont /ZapfDingbats
+>>
+endobj
+16 0 obj <<
+/Type /Font
+/Subtype /Type1
+/Name /F2
+/BaseFont /Helvetica
+/Encoding 14 0 R
+>> endobj
+xref
+0 17
+0000000000 65535 f 
+0000000021 00000 n 
+0000000164 00000 n 
+0000111798 00000 n 
+0000111894 00000 n 
+0000000213 00000 n 
+0000000293 00000 n 
+0000051238 00000 n 
+0000051259 00000 n 
+0000051339 00000 n 
+0000061047 00000 n 
+0000061068 00000 n 
+0000061150 00000 n 
+0000111776 00000 n 
+0000111988 00000 n 
+0000112083 00000 n 
+0000112167 00000 n 
+trailer
+<<
+/Size 17
+/Info 1 0 R
+/Root 2 0 R
+>>
+startxref
+112265
+%%EOF

Modified: branches/distr-2.2/pkg/distr/man/qqplot.Rd
===================================================================
--- branches/distr-2.2/pkg/distr/man/qqplot.Rd	2009-10-05 20:54:36 UTC (rev 593)
+++ branches/distr-2.2/pkg/distr/man/qqplot.Rd	2009-10-05 21:53:00 UTC (rev 594)
@@ -13,7 +13,8 @@
     withConf.pw  = withConf,  withConf.sim = withConf,
     plot.it = TRUE, xlab = deparse(substitute(x)),
     ylab = deparse(substitute(y)), ...,
-    col.IdL = "red", lty.IdL = 2, lwd.IdL = 2,
+    width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
+    mfColRow = TRUE, col.IdL = "red", lty.IdL = 2, lwd.IdL = 2,
     alpha.CI = .95, exact.pCI = (n<100), exact.sCI = (n<100), nosym.pCI = FALSE,
     col.pCI = "orange", lty.pCI = 3, lwd.pCI = 2, pch.pCI = par("pch"),
     cex.pCI = par("cex"),
@@ -41,6 +42,11 @@
 \item{xlab}{x-label}
 \item{ylab}{y-label}
 \item{\dots}{further parameters for function \code{plot}}
+\item{width}{width (in inches) of the graphics device opened}
+\item{height}{height (in inches) of the graphics device opened}
+\item{withSweave}{logical: if \code{TRUE} (for working with \command{Sweave})
+        no extra device is opened and height/width are not set}
+\item{mfColRow}{shall default partition in panels be used --- defaults to \code{TRUE}}
 \item{col.IdL}{color for the identity line}
 \item{lty.IdL}{line type for the identity line}
 \item{lwd.IdL}{line width for the identity line}
@@ -104,6 +110,24 @@
 }
 \examples{
 qqplot(Norm(15,sqrt(30)), Chisq(df=15))
+## some discrete Distributions:
+P <- Pois(5)
+B <- Binom(size=2000,prob=5/2000)
+qqplot(B,P)
+qqplot(B,P, nosym.pCI=TRUE)
+## some Lebesgue-Decomposed distributions:
+mylist <- UnivarLebDecDistribution(discretePart=Binom(3,.3), acPart=Norm(2,2),
+               acWeight=11/20)
+mylist2 <- mylist+0.1
+qqplot(mylist,mylist2)
+qqplot(mylist,mylist2,exact.pCI=FALSE,exact.sCI=FALSE)
+qqplot(mylist,mylist2,nosym.pCI=TRUE)
+## some ac. distribution with a gap
+mylist3 <- UnivarMixingDistribution(Unif(0,0.3),Unif(0.6,1),mixCoeff=c(0.8,0.2))
+gaps(mylist3)
+mylist4 <- UnivarMixingDistribution(Unif(0,0.3),Unif(0.6,1),mixCoeff=c(0.6,0.4))
+qqplot(mylist3,mylist4)
+qqplot(mylist3,mylist4,nosym.pCI=TRUE)
 }
 \keyword{hplot}
 \keyword{distribution}

Modified: branches/distr-2.2/pkg/distrMod/R/qqplot.R
===================================================================
--- branches/distr-2.2/pkg/distrMod/R/qqplot.R	2009-10-05 20:54:36 UTC (rev 593)
+++ branches/distr-2.2/pkg/distrMod/R/qqplot.R	2009-10-05 21:53:00 UTC (rev 594)
@@ -51,6 +51,11 @@
              xlab = deparse(substitute(x)), ## x-label
              ylab = deparse(substitute(y)), ## y-label
              ...,                 ## further parameters
+             width = 10,          ## width (in inches) of the graphics device opened
+             height = 5.5,        ## height (in inches) of the graphics device opened}
+             withSweave = getdistrOption("withSweave"), ## logical: if \code{TRUE}
+             ##               (for working with \command{Sweave}) no extra device is opened and height/width are not set
+             mfColRow = TRUE,     ## shall we use panel partition mfrow=c(1,1)?
              withLab = FALSE,     ## shall observation labels be plotted in
              lab.pts = NULL,      ## observation labels to be used
              which.lbs = NULL,    ## which observations shall be labelled
@@ -140,7 +145,14 @@
     mcl$cex <- cex.pch
     mcl$col <- col.pch
 
+    if (!withSweave){
+           devNew(width = width, height = height)
+    }
+    opar <- par("mfrow")
+    on.exit(do.call(par, list(mfrow=opar)))
 
+    if(mfColRow) opar1 <- par(mfrow = c(1,1))
+
     ret <- do.call(stats::qqplot, args=mcl)
 
     if(withLab&& plot.it){

Modified: branches/distr-2.2/pkg/distrMod/man/qqplot.Rd
===================================================================
--- branches/distr-2.2/pkg/distrMod/man/qqplot.Rd	2009-10-05 20:54:36 UTC (rev 593)
+++ branches/distr-2.2/pkg/distrMod/man/qqplot.Rd	2009-10-05 21:53:00 UTC (rev 594)
@@ -7,8 +7,10 @@
     n = length(x), withIdLine = TRUE,
     withConf = TRUE, withConf.pw  = withConf, withConf.sim = withConf,
     plot.it = TRUE, xlab = deparse(substitute(x)),ylab = deparse(substitute(y)),
-    ..., withLab = FALSE, lab.pts = NULL, which.lbs = NULL, which.Order = NULL,
-    order.traf = NULL, col.IdL = "red", lty.IdL = 2, lwd.IdL = 2, alpha.CI = .95,
+    ..., width = 10, height = 5.5, withSweave = getdistrOption("withSweave"),
+    mfColRow = TRUE, withLab = FALSE, lab.pts = NULL, which.lbs = NULL,
+    which.Order = NULL, order.traf = NULL,
+    col.IdL = "red", lty.IdL = 2, lwd.IdL = 2, alpha.CI = .95,
     exact.pCI = (n<100), exact.sCI = (n<100), nosym.pCI = FALSE,
     col.pCI = "orange", lty.pCI = 3, lwd.pCI = 2, pch.pCI = par("pch"),
     cex.pCI = par("cex"),
@@ -43,6 +45,11 @@
 \item{ylab}{y-label}
 \item{\dots}{further parameters for method \code{qqplot} with signature
 \code{ANY,UnivariateDistribution} or with function \code{plot}}
+\item{width}{width (in inches) of the graphics device opened}
+\item{height}{height (in inches) of the graphics device opened}
+\item{withSweave}{logical: if \code{TRUE} (for working with \command{Sweave})
+        no extra device is opened and height/width are not set}
+\item{mfColRow}{shall default partition in panels be used --- defaults to \code{TRUE}}
 \item{withLab}{logical; shall observation labels be plotted in?}
 \item{lab.pts}{character or \code{NULL}; observation labels to be used}
 \item{which.lbs}{integer or \code{NULL}; which observations shall be labelled}



More information about the Distr-commits mailing list