[Rd] showMethods

Kasper Daniel Hansen khansen at stat.berkeley.edu
Thu Jan 21 05:42:43 CET 2010


There seems to be some unanticipated things happening with showMethods (as far as I can see, it is caused by getGenerics), for packages that have namespaces and has unexported methods.

Example:
library(Matrix)
showMethods(class = "dsyMatrix")

output (with a fair amount removed):

Function "isDiagonal":
 <not a generic function>

Function "isTriangular":
 <not a generic function>

These two functions are S4 methods which are not exported by Matrix.  None of them seems to have a direct method for "dsyMatrix".  Further experimentation (that I cannot recreate with the Recommended packages alone) show that even methods defined (and not exported) in packages that are imported by some other package will show up in the output above.

I would not expect this particular output, I would expect that the two functions above do not show up.  It is unclear to me what I would have expected if (say) isDiagonal actually had a method for dsyMatrix but it was not exported (I would however _prefer_ to be able to see this).

This has some impact for how I (want to) use showMethods to explore functionality in new packages, especially packages that has a huge list of dependencies.  

Kasper


More information about the R-devel mailing list