[Distr-commits] r945 - branches/distr-2.6/pkg/distrEllipse/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 28 12:52:52 CEST 2014


Author: ruckdeschel
Date: 2014-07-28 12:52:52 +0200 (Mon, 28 Jul 2014)
New Revision: 945

Modified:
   branches/distr-2.6/pkg/distrEllipse/R/01.R
   branches/distr-2.6/pkg/distrEllipse/R/AllClasses.R
   branches/distr-2.6/pkg/distrEllipse/R/AllShow.R
   branches/distr-2.6/pkg/distrEllipse/R/EllipticalDistribution.R
   branches/distr-2.6/pkg/distrEllipse/R/MVMixingDistribution.R
Log:
[distrEllipse] removed ::: internal dependencies (within distr-Fam of pkgs) by copying respective routines

Modified: branches/distr-2.6/pkg/distrEllipse/R/01.R
===================================================================
--- branches/distr-2.6/pkg/distrEllipse/R/01.R	2014-07-28 10:47:09 UTC (rev 944)
+++ branches/distr-2.6/pkg/distrEllipse/R/01.R	2014-07-28 10:52:52 UTC (rev 945)
@@ -35,3 +35,37 @@
 {
     infoShow(pkg = "distrEllipse", filename="MASKING", library = library)
 }
+
+#------------------------------------
+#### utilities copied from package distr v.2.6  svn-rev 943
+#------------------------------------
+.isInteger  <- function(x, tol = .Machine$double.eps) abs(as.integer(x)-x)< tol
+.isNatural  <- function(x, tol = .Machine$double.eps) .isInteger(x, tol) & (x>0)
+
+.inArgs <- function(arg, fct)
+          {as.character(arg) %in% names(formals(fct))}
+
+.isEqual <- function(p0, p1, tol = min( getdistrOption("TruncQuantile")/2,
+                                          .Machine$double.eps^.7
+                                          ))
+                abs(p0-p1)< tol
+
+#------------------------------------------------------------------------------
+# issue warnings in show / print as to Arith or print
+#------------------------------------------------------------------------------
+.IssueWarn <- function(Arith,Sim){
+    msgA1 <- msgA2 <- msgS1 <- msgS2 <- NULL
+    if(Arith && getdistrOption("WarningArith")){
+      msgA1 <- gettext(
+       "arithmetics on distributions are understood as operations on r.v.'s\n")
+      msgA2 <- gettext(
+       "see 'distrARITH()'; for switching off this warning see '?distroptions'")
+       }
+    if(Sim && getdistrOption("WarningSim")){
+      msgS1 <- gettext(
+       "slots d,p,q have been filled using simulations; ")
+      msgS2 <- gettext(
+       "for switching off this warning see '?distroptions'")
+       }
+    return(list(msgA=c(msgA1,msgA2), msgS = c(msgS1,msgS2)))
+    }

Modified: branches/distr-2.6/pkg/distrEllipse/R/AllClasses.R
===================================================================
--- branches/distr-2.6/pkg/distrEllipse/R/AllClasses.R	2014-07-28 10:47:09 UTC (rev 944)
+++ branches/distr-2.6/pkg/distrEllipse/R/AllClasses.R	2014-07-28 10:52:52 UTC (rev 945)
@@ -37,7 +37,7 @@
             contains = "EllipticalParameter",
             validity = function(object){
                dim0 <- length(object at loc)
-               if(!distr:::.isNatural(object at df)) stop("'df' must be an integer")
+               if(!.isNatural(object at df)) stop("'df' must be an integer")
                if(!length(object at ncp)==1) stop("wrong dimension for ncp")
                if(!nrow(object at scale)==dim0) stop("wrong dimensions")
                else return(TRUE)

Modified: branches/distr-2.6/pkg/distrEllipse/R/AllShow.R
===================================================================
--- branches/distr-2.6/pkg/distrEllipse/R/AllShow.R	2014-07-28 10:47:09 UTC (rev 944)
+++ branches/distr-2.6/pkg/distrEllipse/R/AllShow.R	2014-07-28 10:52:52 UTC (rev 945)
@@ -35,7 +35,7 @@
           function(object){
             cls <- class(object)[1]
             cat(showobj(object, className = cls))
-            ws <- distr:::.IssueWarn(object at .withArith, object at .withSim)
+            ws <- .IssueWarn(object at .withArith, object at .withSim)
             if(!is.null(ws$msgA)) warning(ws$msgA)
             if(!is.null(ws$msgS)) warning(ws$msgS)
             }

Modified: branches/distr-2.6/pkg/distrEllipse/R/EllipticalDistribution.R
===================================================================
--- branches/distr-2.6/pkg/distrEllipse/R/EllipticalDistribution.R	2014-07-28 10:47:09 UTC (rev 944)
+++ branches/distr-2.6/pkg/distrEllipse/R/EllipticalDistribution.R	2014-07-28 10:52:52 UTC (rev 945)
@@ -17,7 +17,7 @@
       stop("distr must have pos. support")
 
    dr <- d(radDistr)
-   dlog <- if(distr:::.inArgs("log", dr))
+   dlog <- if(.inArgs("log", dr))
            quote(dr(r, log = TRUE)) else quote(log(dr(r)))
 
    if(is(radDistr,"AbscontDistribution")){

Modified: branches/distr-2.6/pkg/distrEllipse/R/MVMixingDistribution.R
===================================================================
--- branches/distr-2.6/pkg/distrEllipse/R/MVMixingDistribution.R	2014-07-28 10:47:09 UTC (rev 944)
+++ branches/distr-2.6/pkg/distrEllipse/R/MVMixingDistribution.R	2014-07-28 10:52:52 UTC (rev 945)
@@ -1,4 +1,3 @@
-.isEqual <- distr:::.isEqual
 
 MultivarMixingDistribution <- function(..., Dlist, mixCoeff #,
 #                                     withSimplify = getdistrOption("simplifyD")
@@ -177,7 +176,7 @@
           function(object){
             cls <- class(object)[1]
             cat(showobj(object, className = cls))
-            ws <- distr:::.IssueWarn(object at .withArith, object at .withSim)
+            ws <- .IssueWarn(object at .withArith, object at .withSim)
             if(!is.null(ws$msgA)) warning(ws$msgA)
             if(!is.null(ws$msgS)) warning(ws$msgS)
           }



More information about the Distr-commits mailing list