[Distr-commits] r111 - pkg/distrMod/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 1 12:36:01 CEST 2008


Author: ruckdeschel
Date: 2008-04-01 12:36:01 +0200 (Tue, 01 Apr 2008)
New Revision: 111

Modified:
   pkg/distrMod/R/AllClass.R
Log:
found way to circumvent warning 
[[[
Warning message:
In .checkSubclasses(class1, classDef, class2, classDef2, where1,  :
  Subclass "derivedDefaultMethodWithTrace" of class "function" is not local and cannot be updated for new inheritance information; consider setClassUnion()
]]]
Solution: Use "OptionalFunction" in class definition...

Modified: pkg/distrMod/R/AllClass.R
===================================================================
--- pkg/distrMod/R/AllClass.R	2008-03-31 11:00:25 UTC (rev 110)
+++ pkg/distrMod/R/AllClass.R	2008-04-01 10:36:01 UTC (rev 111)
@@ -32,7 +32,7 @@
 ### from Matthias' thesis / ROptEst
 ## optional numeric
 setClassUnion("OptionalNumeric", c("numeric", "NULL"))
-setClassUnion("MatrixorFunction", c("matrix", "function"))
+setClassUnion("MatrixorFunction", c("matrix", "OptionalFunction"))
 
 
 ################################
@@ -143,6 +143,9 @@
                       main = numeric(0), nuisance = NULL, trafo = new("matrix")),
             contains = "Parameter",
             validity = function(object){
+                if(! ((is.matrix(object at trafo)) || is.function(object at trafo)))
+                   stop("invalid transformation:\n", 
+                        "should be a matrix or a function") 
                 if(is.matrix(object at trafo)){
                 dimension <- length(object at main) + length(object at nuisance)
 



More information about the Distr-commits mailing list