What's the current best practice for deprecating an S4 generic? Is something along the lines of this approach recommended?
setGeneric(
name = "A",
def = function(object, ...) {
.Deprecated("B")
standardGeneric("B")
}
)
setGeneric(
name = "B",
def = function(object, ...) {
standardGeneric("B")
}
)
Or should the deprecation call be placed inside an ANY
method instead?
setMethod(
f = "A",
signature = signature("ANY"),
definition = function(object, ...) {
.Deprecated("B")
B(object, ...)
}
)
Thanks Marcel. I've started consolidating my S4 generics into a single pacakge when applicable, similar to the BiocGenerics approach. I'm trying to be extremely conservative deprecating generics, but there are a few edge cases where the verbs aren't quite as clear as another spelling, and I want to be able to redirect users and/or revdeps to that improved variant.