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
Currently, Function Reporter will find R6 class methods, but nothing special is being done for S4 or Reference classes.
We need to figure out:
Do we need to do something special, or do we find the methods for free because they are functions (like in S3)? I believe the answer is no for Reference classes, and maybe no for S4, but we should figure this out for sure.
If we need to do something special, implement that as a part of Function Reporter.
Hadley's Advanced R is a great resource for how S4 and Reference classes work.
The text was updated successfully, but these errors were encountered:
From research and testing with adding S4 methods in milne:
S4 has a system of dispatching generics and class methods, much like S3.
Where it is different: These are explicitly registered with functions setGeneric and setMethod, instead of like S3 where they are defined implicitly by following a naming convention that then gets picked up by roxygen2 and registered.
Generic methods will show up as a function in the package namespace.
Class methods do not show up directly in the package namespace.
S4 methods have a dispatch table registered in the package namespace, e.g. for the generic height in package milne:
getNamespace('milne')$`.__T__height:milne`
This is an environment, containing the class methods. The names following the convention class1#class2 where class1 and class2 are the names of the classes in the method signature.
Currently, Function Reporter will find R6 class methods, but nothing special is being done for S4 or Reference classes.
We need to figure out:
Do we need to do something special, or do we find the methods for free because they are functions (like in S3)? I believe the answer is no for Reference classes, and maybe no for S4, but we should figure this out for sure.
If we need to do something special, implement that as a part of Function Reporter.
Hadley's Advanced R is a great resource for how S4 and Reference classes work.
The text was updated successfully, but these errors were encountered: