alittleboy
alittleboy

Reputation: 10966

Function in R intended to be non-visible to end-users

When building an R package, I wrote several functions, but some of them are not very important so I plan to not document them and they're invisible to end-users. However, I use these functions in my Examples section, so they have to be included in the package (but not in the help doc list). I am not sure how to do that. Do I need to:

  1. delete the documentations for that function (in Emacs, not using C-c C-o) so roxygenize won't generate .Rd files?

  2. still wrote the documentations, but without @export?

Thank you very much!

Upvotes: 4

Views: 785

Answers (2)

IRTFM
IRTFM

Reputation: 263451

If you do not export those functions, you will need to call them with the triple colon construct:

myPkg:::myHiddenFn   

There are some example of doing this in some of the base and 'Required' packages help pages.

Upvotes: 5

alittleboy
alittleboy

Reputation: 10966

Thank you all for your suggestions! Yes, I will export my function in the package. The reason I ask this question is that I saw some package authors wrote functions but some of them can only be accessible via pkgName:::funName. I think it's not good either, but just curious how people can achieve this :)

Upvotes: 1

Related Questions