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

From: Allen McIntosh <mcintosh_at_research.telcordia.com>
Date: Sat, 18 Aug 2007 21:12:32 -0400

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 some other function from
> the package
>
> setMethod("foo", signature(obj = "bar"),
> newfoo)

That did it. Thank you.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 19 Aug 2007 - 01:16:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 19 Aug 2007 - 01:38:54 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.