conflicting S4 generics

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

conflicting S4 generics

Torsten Hothorn

Good morning again,

there is a second problem which keeps us from finishing new releases.

Package `kernlab' defines a `fit' S4 generic and `modeltools' does as
well (so this is kind of an internal communication problem). `party' and
`kernlab' define methods for `fit' and export them in their namespaces.

Now, when I attach `party' I get

R> library("party")
R> getMethods(fit)
model = "StatModel", data = "ModelEnv":
structure(function (model, data, ...)
model@fit(data, ...), class = structure("MethodDefinition", package =
"methods"), target = structure(c("StatModel",
"ModelEnv"), .Names = c("model", "data"), class = structure("signature",
package = "methods")), defined = structure(c("StatModel",
"ModelEnv"), .Names = c("model", "data"), class = structure("signature",
package = "methods")))

model = "StatModel", data = "LearningSample":
structure(function (model, data, ...)
model@fit(data, ...), class = structure("MethodDefinition", package =
"methods"), target = structure(c("StatModel",
"LearningSample"), .Names = c("model", "data"), class =
structure("signature", package = "methods")), defined =
structure(c("StatModel",
"LearningSample"), .Names = c("model", "data"), class =
structure("signature", package = "methods")))

Now, when I additionally attach `kernlab', only the `kernlab' definitions
remain active

R> getMethods(fit)
object = "ksvm":
structure(function (object)
object@fit, class = structure("MethodDefinition", package = "methods"),
target = structure("ksvm", .Names = "object", class =
structure("signature", package = "methods")), defined = structure("ksvm",
.Names = "object", class = structure("signature", package = "methods")))

object = "gausspr":
structure(function (object)
object@fit, class = structure("MethodDefinition", package = "methods"),
target = structure("gausspr", .Names = "object", class =
structure("signature", package = "methods")), defined =
structure("gausspr", .Names = "object", class = structure("signature",
package = "methods")))

object = "rvm":
structure(function (object)
object@fit, class = structure("MethodDefinition", package = "methods"),
target = structure("rvm", .Names = "object", class =
structure("signature", package = "methods")), defined = structure("rvm",
.Names = "object", class = structure("signature", package = "methods")))

object = "onlearn":
structure(function (object)
object@fit, class = structure("MethodDefinition", package = "methods"),
target = structure("onlearn", .Names = "object", class =
structure("signature", package = "methods")), defined =
structure("onlearn", .Names = "object", class = structure("signature",
package = "methods")))


and the `party' is over. Is there anything (except agreeing on a common
signature) one can do about it?

Best wishes,

Torsten

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel