[R-pkg-devel] Creating S3 methods for S4 classes
Jori@@Mey@ @ending from ugent@be
Thu May 24 14:17:07 CEST 2018
per the manual, one should create and register both the S3 and a S4 method
if one needs a method for an S4 class for a function using S3 dispatching.
This is cumbersome, and not very optimal.
I was wondering if there's a better way to do this. Currently I recreate a
generic in my package and create a default method that sends all the other
classes to the S3 generic, eg:
setMethod("predict", "ANY", stats::predict)
I'm not sure if this hasn't any adverse consequences, as it is not the
It would be great if these generics could be made available through stats4.
If this would be the prefered route, I volunteer to create the patch for
Department of Data Analysis and Mathematical Modelling
Coupure Links 653, B-9000 Gent (Belgium)
tel: +32 (0)9 264 61 79
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
[[alternative HTML version deleted]]
More information about the R-package-devel