Skip to content

"Proper" way to use a "hidden" function in an R-package?

3 messages · Jonathan Greenberg, Gabriel Becker, Dirk Eddelbuettel

#
I think part of this may be my (possibly flawed) understanding of
documentation requirements for CRAN -- if a function is exported to
the namespace, does CRAN require documentation of that function?  The
reason I ask is that I have a lot of these little functions that have
no need for documentation (since they are only used internally by a
larger, documented function -- no end-user would touch them).  If this
is flawed understanding, do I just export it to the NAMESPACE and I'm
good to go?

--j

On Fri, Jul 12, 2013 at 11:35 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:

  
    
#
On 12 July 2013 at 11:42, Gabriel Becker wrote:
| Jonathan,
| 
| All exported functions must have documentation entries to pass R CMD check
| without warnings.
| 
| Functions within your package do not need another function in your package
| to be exported to call it without :::, but code not in your package (ie
| functions in other packages or user code) do.
| 
| If you have reason to believe that a user or function from another package
| will directly call a function, it should be exported, and thus documented.
| If not, you can use them within code in your own package without exporting
| them, using :::, or documenting them.

All true, but what Jonathan _really_ wanted to know is that adding a single 

    \alias{nameOfThatFunction}

in an .Rd file will also satisfy R CMD check.  Some package use a file
undocumented.Rd to regreoup these; I sometimes use the Packagename-package.Rd
file.

Dirk