From hpages at fhcrc.org  Fri Oct 27 03:02:44 2006
From: hpages at fhcrc.org (Herve Pages)
Date: Thu, 26 Oct 2006 18:02:44 -0700
Subject: [Rd] Pb with .findInheritedMethods
In-Reply-To: <454142C1.9030809@fhcrc.org>
References: <454142C1.9030809@fhcrc.org>
Message-ID: <45415AB4.3050505@fhcrc.org>

Hi again,

This happens with R-2.4.0 and R-devel.

Cheers,
H.

Herve Pages wrote:
> Hi again,
>
>
> Here is a very simplified version of a class hierarchy
> defined in the Biobase package (Bioconductor). I post
> here because this seems to be an S4 related problem:
>
>     setClass("A", representation(name="character"))
>     setMethod("initialize", "A", function(.Object) {.Object at name <- "I'm
>     an A"; .Object})
>
>     setClass("Ab", contains="A")
>     setMethod("initialize", "Ab", function(.Object) callNextMethod(.Object))
>
>     setClass("Abc", contains="Ab")
>
>     setClass("Abcd", contains = c("Abc"))
>
> Now if I do:
>
>     tmp1 <- new("Abc")
>     tmp2 <- new("Abcd")
>
> I get the following warning:
>
>     Warning message:
>     Ambiguous method selection for "initialize", target "Abcd" (the
>     first of the signatures shown will be used)
>         Abc
>         Ab
>      in: .findInheritedMethods(classes, fdef, mtable)
>
> I don't really understand why .findInheritedMethods is
> complaining here...
> And if I don't do 'tmp1 <- new("Abc")' before I
> do 'tmp2 <- new("Abcd")', then I don't get the warning
> anymore!
>
> Does anybody have an explanation for this?
>
>
> Thanks,
> H.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>




[Rd] Pb with .findInheritedMethods
Herve Pages