[Distr-commits] r994 - in branches/distr-2.6/pkg/distr: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 18 14:19:24 CET 2015


Author: ruckdeschel
Date: 2015-02-18 14:19:24 +0100 (Wed, 18 Feb 2015)
New Revision: 994

Modified:
   branches/distr-2.6/pkg/distr/R/internals-qqplot.R
   branches/distr-2.6/pkg/distr/inst/NEWS
   branches/distr-2.6/pkg/distr/man/internals-qqplot.Rd
Log:
[distr] changed helper .isReplicated

Modified: branches/distr-2.6/pkg/distr/R/internals-qqplot.R
===================================================================
--- branches/distr-2.6/pkg/distr/R/internals-qqplot.R	2015-02-03 13:57:28 UTC (rev 993)
+++ branches/distr-2.6/pkg/distr/R/internals-qqplot.R	2015-02-18 13:19:24 UTC (rev 994)
@@ -10,10 +10,10 @@
   sapply(x, function(y) length(which(fct(y,gapm)))>0)
 }
 
-.isReplicated <- function(x){
+.isReplicated <- function(x, tol=.Machine$double.eps){
   tx <- table(x)
   rx <- as.numeric(names(tx[tx>1]))
-  sapply(x, function(y) any(abs(y-rx)<.Machine$double.eps))
+  sapply(x, function(y) any(abs(y-rx)<tol))
 }
 
 .NotInSupport <- function(x,D){

Modified: branches/distr-2.6/pkg/distr/inst/NEWS
===================================================================
--- branches/distr-2.6/pkg/distr/inst/NEWS	2015-02-03 13:57:28 UTC (rev 993)
+++ branches/distr-2.6/pkg/distr/inst/NEWS	2015-02-18 13:19:24 UTC (rev 994)
@@ -49,7 +49,8 @@
 -plot: 
  + fixed some issues with plotting of distributions: xlim, ylim were not 
    correctly passed on, same for col => now use dots.lowlevel ... 
-
+-helper function .isReplicated gains an optional argument tol
+   
 ##############
 v 2.5.3
 ##############

Modified: branches/distr-2.6/pkg/distr/man/internals-qqplot.Rd
===================================================================
--- branches/distr-2.6/pkg/distr/man/internals-qqplot.Rd	2015-02-03 13:57:28 UTC (rev 993)
+++ branches/distr-2.6/pkg/distr/man/internals-qqplot.Rd	2015-02-18 13:19:24 UTC (rev 994)
@@ -21,7 +21,7 @@
 
 \usage{
 .inGaps(x,gapm)
-.isReplicated(x)
+.isReplicated(x, tol = .Machine$double.eps)
 .NotInSupport(x,D)
 .SingleDiscrete(x,D)
 .makeLenAndOrder(x,ord)
@@ -53,6 +53,7 @@
   an \code{"AbscontDistribution"} or \code{"UnivarLebDecDistribution"}
   object.
   }
+\item{tol}{numeric; tolerance for separating points.}
 \item{D}{object of class \code{"UnivariateDistribution"}}
 \item{datax}{logical; (to be used in \pkg{distrMod}) shall data be plotted on x-axis?}
 \item{ord}{integer; the result of a call to \code{order}}



More information about the Distr-commits mailing list