Conversation
|
Maybe it should not be exported 🤔 |
|
Thanks a lot, this is really cool! 2 questions / comments
|
For the case at hand, I'd say it's equivalent. The main benefits (as far as I know) of using S3 in the general case:
f <- function(x) {
if (inherits(x, "class1") {
do1(x)
} else if (inherits(x, "class2") {
do2(x)
} else {
do3(x)
}
}Now what happens when you have an object If we use a S3 system in this case, |
|
For the other point, I'll think about it. It might be the thing that I overlooked and that makes this impossible (hence why nobody suggested this idea). |
|
I'm closing this for now as we're not sure what to do with the return statements. Please feel free to open again! |
As discussed in #130.
Feel free to edit anything in any way you like before merging.