[Rd] conflicting S4 generics

Torsten Hothorn Torsten.Hothorn at rzmail.uni-erlangen.de
Wed Feb 15 10:26:55 CET 2006


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 at 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 at 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 at 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 at 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 at 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 at 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



More information about the R-devel mailing list