0

我不知道如何处理泛型函数的名称,例如

     setClass(Class = "ABC",
              representation = representation(a="numeric")
     ) 
     ABC<-function(a=1){new("ABC",a=a)}
     setGeneric("geta", function(object) standardGeneric("geta"))
     setMethod("geta", signature = "ABC", definition = function(object) object@a)
     a<-ABC()
     geta(a)
     geta<-4
     geta(a)#Error: could not find function "geta"

你明白我的意思,函数丢失或被geta<-4.

4

0 回答 0