You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
method_from_call() works only on S4 methods and not on S3 methods.
Indeed, the doc says "find corresponding S4 method", but it never explicitly tells us it cannot find S3 methods.
If this is a technical limitation, I think it would be worth mentioning it in the doc, maybe in a @details section (and likewise if it is a WIP).
Moreover, it is not evident for a naive user (like me) whether a method is S3 or S4, and the error message is not very helpful:
pryr::method_from_call(mean(1:10))
#> Warning in formals(fun): argument is not a function#> Error in getGeneric(f, !optional): no generic function found for 'mean'
Hi,
method_from_call()
works only on S4 methods and not on S3 methods.Indeed, the doc says "find corresponding S4 method", but it never explicitly tells us it cannot find S3 methods.
If this is a technical limitation, I think it would be worth mentioning it in the doc, maybe in a
@details
section (and likewise if it is a WIP).Moreover, it is not evident for a naive user (like me) whether a method is S3 or S4, and the error message is not very helpful:
Created on 2023-02-04 with reprex v2.0.2
Note that this reprex is oddly only really reproducible inside
reprex()
: in a fresh R session, amean()
call will work, but ananova()
call will not.The text was updated successfully, but these errors were encountered: