[Rd] Namespace/inheritance problem in S4 methods for a union class

2013-05-07 Thread Renaud Gaujoux
Hi, I started this post on bioc-devel but this seems to be more general: https://stat.ethz.ch/pipermail/bioc-devel/2013-May/004311.html See reproducible example from Martin below. Thank you. Renaud -- Forwarded message -- From: Martin Morgan Date: 7 May 2013 19:55 Subject: Re

Re: [Rd] Namespace/inheritance problem in S4 methods for a union class

2013-05-08 Thread John Chambers
No need for generic functions and methods. Just looking at the hierarchy of the classes shows the problem. With Martin's simplified version: > library(PkgA) > extends("A") [1] "A" > library(PkgB) > extends("B") [1] "B" "A" > setClassUnion("C", c("matrix", "A")) > extends("A") [1] "A" "C" > ext

Re: [Rd] Namespace/inheritance problem in S4 methods for a union class

2013-05-08 Thread Renaud Gaujoux
I obviously cannot predict the implications as much as John, but would the followings be solutions: - setClassUnion looks up for subclasses of its elements and add them up, and setClass('A', ...) would update the union classes of any superclass of 'A'. removeClass would need to do some cleanup, wh

Re: [Rd] Namespace/inheritance problem in S4 methods for a union class

2013-05-09 Thread John Chambers
The problem is not with setting up the union, but with updating the cached version of the subclasses that are implicitly members of the union. Think of it this way. Class "B" does not have a superclass "C" in its incarnation on PkgB. Only dynamically in the situation you have created does thi