Johannes Huesing
2008-Jun-29 06:13 UTC
[R] Accessing methods and extending S4 classes of existing packages
Dear all, I am trying to understand how to access S4 methods after loading a package, using the online documentation of getMethod and friends. This is what I have been trying:> library(coin) > findMethods("ApproxNullDistribution")list() Warning message: In findMethods("ApproxNullDistribution") : nicht-generische Funktion an findMethods() ?bergeben whereas in the source of coin I can see the lines: setGeneric("ApproxNullDistribution", function(object, ...) standardGeneric("ApproxNullDistribution")) It seems that I am not getting what is going on here. Could anybody give me a hint? Greetings Johannes -- Johannes H?sing There is something fascinating about science. One gets such wholesale returns of conjecture mailto:johannes at huesing.name from such a trifling investment of fact. http://derwisch.wikidot.com (Mark Twain, "Life on the Mississippi")
Johannes Huesing
2008-Jun-29 14:50 UTC
[R] Accessing methods and extending S4 classes of existing packages
Johannes Huesing <johannes at huesing.name> [Sun, Jun 29, 2008 at 08:13:27AM CEST]:> Dear all, > I am trying to understand how to access S4 methods after loading a > package, using the online documentation of getMethod and friends. >I am just realizing that the lack of online documentation on S4 methods, which was lamented so long, has apparently been filled by "How S4 Methods Work" by John Chambers. So please hang on until I have read this piece and will be able to ask more educated questions about that matter. -- Johannes H?sing There is something fascinating about science. One gets such wholesale returns of conjecture mailto:johannes at huesing.name from such a trifling investment of fact. http://derwisch.wikidot.com (Mark Twain, "Life on the Mississippi")
Johannes Huesing
2008-Jun-29 18:17 UTC
[R] Accessing methods and extending S4 classes of existing packages
Johannes Huesing <johannes at huesing.name> [Sun, Jun 29, 2008 at 08:13:27AM CEST]:> Dear all, > I am trying to understand how to access S4 methods after loading a > package, using the online documentation of getMethod and friends. > > This is what I have been trying: > > library(coin) > > findMethods("ApproxNullDistribution") > list() > Warning message: > In findMethods("ApproxNullDistribution") : > nicht-generische Funktion an findMethods() ?bergeben > > whereas in the source of coin I can see the lines: > > setGeneric("ApproxNullDistribution", function(object, ...) > standardGeneric("ApproxNullDistribution")) > > It seems that I am not getting what is going on here. Could anybody > give me a hint?It seems like the package authors chose not to export the ApproxNullDistribution generic method from the package, as seen in the NAMESPACE file of the package. Does it mean that if I want to write personal extensions to the package, the correct approach is to take the whole package and modify it? -- Johannes H?sing There is something fascinating about science. One gets such wholesale returns of conjecture mailto:johannes at huesing.name from such a trifling investment of fact. http://derwisch.wikidot.com (Mark Twain, "Life on the Mississippi")