Re: [Rd] Overriding S4 methods in an installed package

2007-08-18 Thread Allen McIntosh
Duncan Murdoch wrote: > I think you can set the environment of your method to see the package > internals. Those internals won't see your method, though. > > To do this, you'd do something like > > newfoo <- function(obj , x, y) { new definition } > environment(newfoo) <- environment(foo) # or

Re: [Rd] Overriding S4 methods in an installed package

2007-08-18 Thread Duncan Murdoch
Allen McIntosh wrote: > Seth Falcon wrote: > >> Allen McIntosh <[EMAIL PROTECTED]> writes: >> >>> Is it possible to override S4 methods in an installed package? >>> The naive >>> library("pkg") >>> setMethod("foo", signature(obj = "bar"), >>> function(obj , x, y) { new definition }

Re: [Rd] Overriding S4 methods in an installed package

2007-08-18 Thread Allen McIntosh
Seth Falcon wrote: > Allen McIntosh <[EMAIL PROTECTED]> writes: >> Is it possible to override S4 methods in an installed package? >> The naive >> library("pkg") >> setMethod("foo", signature(obj = "bar"), >> function(obj , x, y) { new definition } >> , where="package:pkg") >> results i

Re: [Rd] Overriding S4 methods in an installed package

2007-08-18 Thread Seth Falcon
Allen McIntosh <[EMAIL PROTECTED]> writes: > Is it possible to override S4 methods in an installed package? > The naive > > library("pkg") > setMethod("foo", signature(obj = "bar"), > function(obj , x, y) { new definition } > , where="package:pkg") > > > results in the error > > Erro

[Rd] Overriding S4 methods in an installed package

2007-08-18 Thread Allen McIntosh
Is it possible to override S4 methods in an installed package? The naive library("pkg") setMethod("foo", signature(obj = "bar"), function(obj , x, y) { new definition } , where="package:pkg") results in the error Error in setMethod("foo", signature(obj = "bar"), function(obj, :