[Distr-commits] r590 - in branches/distr-2.2/pkg: . distrDoc/inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 25 12:17:45 CEST 2009


Author: ruckdeschel
Date: 2009-09-25 12:17:45 +0200 (Fri, 25 Sep 2009)
New Revision: 590

Modified:
   branches/distr-2.2/pkg/distrDoc/inst/doc/distr.Rnw
   branches/distr-2.2/pkg/qqplot.R
Log:
+fixed small typo in distrDoc detected by Josef Leydold (thanks)
+new helper function for qqplot.R --- in general: need to rework discrete case: CI's only make sense on support points of distribution 

Modified: branches/distr-2.2/pkg/distrDoc/inst/doc/distr.Rnw
===================================================================
--- branches/distr-2.2/pkg/distrDoc/inst/doc/distr.Rnw	2009-09-11 17:00:20 UTC (rev 589)
+++ branches/distr-2.2/pkg/distrDoc/inst/doc/distr.Rnw	2009-09-25 10:17:45 UTC (rev 590)
@@ -815,7 +815,7 @@
 This behaviour will soon be annoying so you may switch it off setting the global 
 option \code{WarningArith} to \code{FALSE} (see section~\ref{options}).\medskip\\
 %
-Function \code{distrArith()} displays the following comment
+Function \code{distrARITH()} displays the following comment
 \begin{footnotesize} 
 \begin{quote} 
 \begin{verbatim}

Modified: branches/distr-2.2/pkg/qqplot.R
===================================================================
--- branches/distr-2.2/pkg/qqplot.R	2009-09-11 17:00:20 UTC (rev 589)
+++ branches/distr-2.2/pkg/qqplot.R	2009-09-25 10:17:45 UTC (rev 590)
@@ -35,6 +35,16 @@
   sapply(x, function(y) any(abs(y-rx)<.Machine$double.eps))
 }
 
+.NotInSupport <- function(x,D){
+  nInSupp <- which(x < q(D)(0))
+  nInSupp <- unique(sort(c(nInSupp,which( ! x > q(D)(1)))))
+      if("support" %in% names(getSlots(class(D))))
+         nInSupp <- unique(sort(c(nInSupp,which( ! x %in% support(D)))))
+      if("gaps" %in% names(getSlots(class(D))))
+         nInSupp <- unique(sort(c(nInSupp,which( .inGaps(x,gaps(D))))))
+  return(nInSupp)
+}
+
 .makeLenAndOrder <- function(x,ord){
    n <- length(ord)
    x <- rep(x, length.out=n)
@@ -270,12 +280,7 @@
 
     if(check.NotInSupport){
        xco <- sort(xc)
-       nInSupp <- which(xco < q(y)(0))
-       nInSupp <- unique(sort(c(nInSupp,which( ! xco > q(y)(1)))))
-       if("support" %in% names(getSlots(class(y))))
-          nInSupp <- unique(sort(c(nInSupp,which( ! xco %in% support(y)))))
-       if("gaps" %in% names(getSlots(class(y))))
-          nInSupp <- unique(sort(c(nInSupp,which( .inGaps(xco,gaps(y))))))
+       nInSupp <- .NotInSupport(xc,y)
        if(length(nInSupp)){
           col.pch[nInSupp] <- col.NotInSupport
        }



More information about the Distr-commits mailing list