On 29/05/2017 11:45 AM, Markus Müller wrote:
Hi
I am developing a small package that converts comments to documentation.
One of my  design aims is to duplicate as little as possible of R 's
internal machinery.

In particular I want to load the package (to be documented) with 'library',
inspect all its objects like functions,generics methods and classes and
then apply my genericFunction  'writeRdFile'
to every one of these objects.
If possible I want to avoid parsing the package code myself.
This works well for functions, generics, S4 methods since 'srcref'  in
these cases yields the snippet of code that I want.

For S4 classes it yields NULL however, while I would like to something like
setClass(Class=MyClass,representation....

Is there an alternative ?


Source reference information is kept for function and method bodies, but not for class definitions, so you'll need to do some more work to reconstruct the calls. That may have been done already; hopefully if so someone else will point out where.

Duncan Murdoch

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to